simonw / datasette

An open source multi-tool for exploring and publishing data
https://datasette.io
Apache License 2.0
9.56k stars 691 forks source link

I18n and L10n support #173

Open janimo opened 6 years ago

janimo commented 6 years ago

It would be less geeky and more user friendly if the display strings in the filter menu and possibly other parts could be localized.

ColinMaudry commented 3 years ago

I have the feeling that the text visible to users is 95% present in template files (datasette/templates). The python code mainly contains error messages.

In the current situation, the best way to provide a localized frontend is to translate the templates and configure datasette to use them. I think I'm going to do it for French.

If we want localization to be better integrated, for the python code, I think gettext is the way to go. The .po can be translated in user-friendly tools such as Transifex and Crowdin.

For the templates, I'm not sure how we could do it cleanly and easy to maintain. Maybe the tools above could parse HTML and detect the strings to be translated.

In any case, localization implementing l10n is just the first step: a continuous process must be setup to maintain the translations and produce new ones while datasette keeps getting new features.

ColinMaudry commented 3 years ago

I found a neat tutorial to set up gettext with jinja2: http://siongui.github.io/2016/01/17/i18n-python-web-application-by-gettext-jinja2/