Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Improve relative time in Chinese locales #818

wants to merge 2 commits into from

Conversation

ZYinMD
Copy link
Contributor

@ZYinMD ZYinMD commented Mar 5, 2020

Two minor changes to the relative date part in the Chinese locales zh-cn, zh-hk, and zh-tw.

  • fix spacing in relative time:
    There should be no whitespace between numbers and units in Chinese.
    For instance, 3 days is 3天, not 3 天.

  • fix wording of "future" in relative time:
    The correct word for "future" in Chinese is 后, not 内.
    For instance, in 3 days is 3天后, not 3天内.

ZYinMD added 2 commits March 5, 2020 09:40
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
Copy link

codecov bot commented Mar 5, 2020

Codecov Report

Merging #818 into dev will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b54150e...35d2e37. Read the comment docs.

@iamkun
Copy link
Owner

iamkun commented Mar 5, 2020

Hi, we keep the same with moment.js

https://github.com/moment/moment/blob/develop/locale/zh-cn.js#L84

@ZYinMD
Copy link
Contributor Author

ZYinMD commented Mar 5, 2020

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?

@iamkun
Copy link
Owner

iamkun commented Mar 5, 2020

@ZYinMD That would be nice. I will merge this as soon as that PR get merged.

@ZYinMD
Copy link
Contributor Author

ZYinMD commented Mar 5, 2020

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.

@iamkun
Copy link
Owner

iamkun commented Mar 6, 2020

我也觉得我们的中文写法需要改一下会更地道,但是现在比较纠结的事情是还要不要和 moment 保持一致,如果不一致,和这个库一开始做的初衷又不一样了

@ZYinMD
Copy link
Contributor Author

ZYinMD commented Mar 6, 2020

矮马, dayjs的作者大佬原来是同胞, 66666, 之前都没注意到~ 你觉得in 2 months翻译成2个月内真的合适嘛?

我暂时去node_modules里面改源码来解决我自己的应用问题~ 你先继续纠结吧~ 对于这个PR的决定, 你绝对是全世界第一权威

moment肯定不如你权威, 如果是其他locale的PR也就算了, 这个关于zh的PR肯定是你最权威~ 况且moment已经凉了, 哈哈

@iamkun
Copy link
Owner

iamkun commented Mar 6, 2020

https://day.js.org/docs/en/plugin/update-locale 你可以用这个 不用改 node module

Ref #805 (comment)

@ZYinMD
Copy link
Contributor Author

ZYinMD commented Mar 6, 2020

哦哦哦! 管用管用!! 谢谢!! 没好好看doc是我的锅

话说, 我又想到了一个政治正确的workaround, 等我去新开一个issue

@iamkun
Copy link
Owner

iamkun commented Mar 10, 2020

#822

@iamkun iamkun closed this Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants