eddiewebb / flarum-calendar

MIT License
16 stars 8 forks source link

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

Open Ecss11 opened 1 year ago

Ecss11 commented 1 year ago

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.

cneicy commented 3 months ago

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