Open HolgerHuo opened 1 year ago
Seems that to have all date displayed across the site to be correctly displayed in zh-hans/zh-hant locale, we will have to rename those jsons as Ghost's api can only take zh-cn/zh-hk style formatting.
Hi,
The function formatDate()
is only used to format the dates in search results when the native search is not enabled, all the rest of dates that are displayed across the pages don't use that function, Ghost handles that.
The locale files also don't handle dates, maybe this is an issue with Ghost itself, I would suggest you to reach their support team to see if they can find a proper solution.
Hi! Thanks for your reply.
The function formatDate() is only used to format the dates in search results when the native search is not enabled, all the rest of dates that are displayed across the pages don't use that function, Ghost handles that.
The rest of date locale follows this format for Chinese language: zh-cn/zh-hk. Maybe we should consider renaming the locales files' name to this format too as Ghost use zh-cn/zh-hk to select theme's language.
formatDate()
function usesDate.prototype.toLocaleDateString()
to convert date string, which takes inBCP 47 Language Tags
as locale setting. However, locale files are using zh-hans/zh-hant style formatting, causing the theme to unable to translate date strings.We could either add a layer of translation between zh-hans/zh-hant to zh-cn/zh-hk or update locale jsons; however, the former one isn't very graceful while the latter may result in
Breaking change
. Maybe there is a better solution to this?BTW, thanks for creating this theme!