cryptboard.io
cryptboard.io copied to clipboard
Consider adding multi-language support
Can you consider adding multilingual support? I can help translate the zh-CN version.
Hello. I have some initial parts of multilingual support, but as for now it's far from completion. I need some time to remember the code, and make a decisions on how to implement translation to the code, where it wasn't planned at the beginning of development. Give me some time, and I'll return with some timeline on when it could be implemented
I've checked the code. The roadmap of changes should be following:
- Create configuration option that allows to set language, and functionality to detect it by user's browser
- Build a pack of json files with translated strings. At first it would be en, and ru (as I can translate strings to russian)
- Create simple translated-string-selection function, what would be using "current language" and substitute english text string with selected language. Something like
_t("english string")
- or just find some vanillajs gettext implementation and use it. - Create function which, at page load, can walk by it's content and replace special variables, such as
{{english string}}
into corresponding language's strings (actually, I'm already have such a function in other project) - Walk through all the templates, where texts are hardcoded (for example, buttons titles) and replace
english strings
with{{english strings}}
- Walk through the javascript code, and wrap strings, used to show information to user in
_f(...)
expressions - Create separated folders for markdown information files (that are used in static pages generation), for the beginning -
ru
version, create translated versions on the texts - Add backend functionality so it can render the needed language file into frontend.
- And at this point it could be possible to at last start to create translations for every language needed.
Maybe it'll be good to have *.po and *.mo files that are used by gettext library and can be edited with lots of software and online tools