flarum-calendar icon indicating copy to clipboard operation
flarum-calendar copied to clipboard

Date picker not displays on event creation in other language like Chinese Simplified

Open Ecss11 opened this issue 1 year ago • 1 comments

Description

The code can be found in js/src/forum/components

The date picker does not loaded when forum language is Chinese Simplified because const userLang = app.translator.getLocale(); return zh-Hans instead of zh, this caused the JS not loaded correctly when calling flatpickr's functions. In nutshell, flatpickr requires zh, while the flarum method return zh-Hans.

Possible Fix

Currently, we replace the const userLang with zh to solve the problem. In alternative, I think the problem can also be solved by creating a mapping to these particular languages.

Ecss11 avatar Jun 28 '23 04:06 Ecss11

I forked Chinese Simplified, and change the "code": "zh-Hans" to "code": "zh".It just works.🤣

cneicy avatar Jun 08 '24 01:06 cneicy