flarum-calendar
flarum-calendar copied to clipboard
Date picker not displays on event creation in other language like Chinese Simplified
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.
I forked Chinese Simplified, and change the "code": "zh-Hans" to "code": "zh".It just works.🤣