Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add chinese
  • Loading branch information
1lann committed Mar 14, 2021
commit 7d2c3a01b9c1f1c19d810f835893972d90bd9bbf
14 changes: 14 additions & 0 deletions src/__data__/languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,19 @@
"url": "https://github.com/signalhunter"
}
]
},
"zh_CN": {
"name": "Chinese (Simplified)",
"nativeName": "简体中文",
"country": "cn",
"antLocale": "zh_CN",
"dayjsLocale": "zh",
"timeagoLocale": "zh",
Comment on lines +82 to +83

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm mistaken, I believe the timeago locale is zh-CN:
https://github.com/nmn/react-timeago/blob/master/src/language-strings/zh-CN.js

Day.js also has zh and zh-cn, which have some tiny differences (relativeTime.future), not sure which one is correct here, I'll leave that to your judgement:
https://github.com/iamkun/dayjs/blob/dev/src/locale/zh-cn.js
https://github.com/iamkun/dayjs/blob/dev/src/locale/zh.js

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh ok I didn't know where those locales really came from, but yeah I'll change that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference to anyone reading this, they're documented in the translating section in the README: https://github.com/tmpim/KristWeb2#contributing-translations

"contributors": [
{
"name": "1lann",
"url": "https://github.com/1lann"
}
]
}
}