pacificclimate / design-value-explorer

Web application for interactively visualizing and downloading design value fields and tables.
GNU General Public License v3.0
0 stars 0 forks source link

Handle multiple languages #224

Closed rod-glover closed 2 years ago

rod-glover commented 2 years ago

DVE is to be released in French and English versions.

The config files currently contain a mix of text for presentation (i.e., English) and non-text config (values used by the code).

Possible implementations

Quick and dirty

Copy the configs and substitute the text for presentation parts. With that approach, it is possible (and easy, if you're not careful) to have different code configs for each language, which is highly undesirable.

Deploy at 2 different URLs, say .../dv-explorer/en and .../dv-explorer/fr with different config files containing the two language versions. We could if desired put a link at the top of each app to the other language, content determined by config, natch.

Cleaner

Separate text for presentation from code config. This would take more work but prevent inconsistencies between English and French versions.

Deploy at 2 different URLs, say .../dv-explorer/en and .../dv-explorer/fr with different config files containing the two language versions. We could if desired put a link at the top of each app to the other language, content determined by config, natch.

Cleanest(?)

Config separated like "Cleaner", plus ...

Deploy a single version of the app that can toggle dynamically between languages. It's not clear whether this would be worth the (modest) effort, but it would mean that all deployments of the app (e.g., if we configure several Gunicorn workers or several distinct deployments) support both languages, spreading the load better (I'm assuming there will be less load on the French version than the English).

Mixed, less dirty

In a single mixed-type config, add "en" and "fr" properties for each config piece of presentation text. Select the language with an env var (or, if desired, a selector in the app ... definitely doable).

Deploy to separate URLs (fixed lang via env var) or to single URL (selectable lang in app).

rod-glover commented 2 years ago

I prefer the "Mixed, less dirty" option, at least for now. It is flexible without being a lot of work. Config files are nastier, but we can handle that.

rod-glover commented 2 years ago

After a couple of days' thought, I still prefer "Mixed, less dirty". It will allow us to make each deployment serve both languages, and will require the minimum of intervention in the config files and their usage.