-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve relative time in Chinese locales #818
Conversation
This affects the zh-cn, zh-hk, and zh-tw locales. In Chinese, there is no whitespace between numbers and units. For instance, "3 days" is "3天", not "3 天"
This affects the zh-cn, zh-hk, and zh-tw locales. In Chinese, the correct word for future is 后, not内 For instance, "in 3 days" is"3天后", not"3天内"
Codecov Report
@@ Coverage Diff @@
## dev #818 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 157 157
Lines 1148 1148
Branches 215 215
=========================================
Hits 1148 1148 Continue to review full report at Codecov.
|
Hi, we keep the same with moment.js https://github.com/moment/moment/blob/develop/locale/zh-cn.js#L84 |
I don't mind submitting a pull request to moment.js, but are they still being actively maintained and accepting new merges? It seems their last release was January 2019? |
@ZYinMD That would be nice. I will merge this as soon as that PR get merged. |
Hi @iamkun , but is momentjs is still being maintained? I see they have PRs piling up for over a year, and nobody is reviewing. Many of these PRs are small improvements to different locales submitted by native speakers. |
我也觉得我们的中文写法需要改一下会更地道,但是现在比较纠结的事情是还要不要和 moment 保持一致,如果不一致,和这个库一开始做的初衷又不一样了 |
矮马, dayjs的作者大佬原来是同胞, 66666, 之前都没注意到~ 你觉得 我暂时去node_modules里面改源码来解决我自己的应用问题~ 你先继续纠结吧~ 对于这个PR的决定, 你绝对是全世界第一权威 moment肯定不如你权威, 如果是其他locale的PR也就算了, 这个关于zh的PR肯定是你最权威~ 况且moment已经凉了, 哈哈 |
https://day.js.org/docs/en/plugin/update-locale 你可以用这个 不用改 node module Ref #805 (comment) |
哦哦哦! 管用管用!! 谢谢!! 没好好看doc是我的锅 话说, 我又想到了一个政治正确的workaround, 等我去新开一个issue |
Two minor changes to the relative date part in the Chinese locales
zh-cn
,zh-hk
, andzh-tw
.fix spacing in relative time:
There should be no whitespace between numbers and units in Chinese.
For instance,
3 days
is3天
, not3 天
.fix wording of "future" in relative time:
The correct word for "future" in Chinese is 后, not 内.
For instance,
in 3 days
is3天后
, not3天内
.