Relative date format issue

the relative date in Chinese language has unnecessary spaces,
usually the date format should be “mm月dd日”, the current format is “mm月 dd 日”,
I haven’t found any issue with the translation, and also I think the ember helper lead to this issue
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/formatter.js
I think function autoUpdatingRelativeAge adds the extra spaces.
I understand this is not an issue for English version discourse, but may cause some format issues for other languages.
I tried javascript to remove the spaces, but it won’t work with the lazy loading content.
I’m appreciated to any tips for modifying the ember helper in a plugin or any fix from the main branch.

这似乎是一个由区域设置文件中的日期格式字符串引起的 Contribute > Bug(简化中文问题)。查看 git 历史记录,在 v3.3.0 版本中,格式为:

看起来它们最近被更新为(在 3.4.0.beta1-dev 中已确认生效):

在 codepen 中使用默认的 Momentjs 配置 for zh-cn 测试格式字符串 "MMM D 日",它产生了观察到的缺陷(即 "8月 2 日")。

对于即时修复,您可以通过翻译 js.dates.tiny.date_monthjs.dates.long_no_year_no_time 来更改格式,如下所示:

2 个赞