Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app dashboard translation #112

Closed
12rambau opened this issue Jun 10, 2021 · 2 comments
Closed

app dashboard translation #112

12rambau opened this issue Jun 10, 2021 · 2 comments

Comments

@12rambau
Copy link
Member

All the applications are running on instances (from R studio to the voila based app). meaning that at the moment they all fallback in english as it's the instance default language.

We worked to ensure that the rest of the website is translated in both Spanish and French and the procedure would be quite easy if one would like to add an extra language: add a file with the language iso code and copy and translate all the keys from en.json (https://github.com/openforis/sepal/tree/master/modules/gui/frontend/src/locale).

Problem being that this translation mechanism is not transmitted to the instances forcing the applications to fallback to english. As it's a web server Shiny is the only one that can jump from one language to another by reserving the app after clicking on a button.

For Rstudio, JupyterLab and Jupyter Notebook, the LANG (currently defaulting to en_US.UTF-8) need to be changed (the languages are all already internally supported). In the app based on the sepal_ui framework the Translator object can listen to any env variable to guess the language to use.

Would it be possible to align the LANG env variable to the one used in SEPAL when we open a new instance?
If not would it be possible to automatically create a custom variable that we can listen to when a new instance is opened?

If you have any other idea to translate the tools available in the app dashboard please add a comment

@12rambau
Copy link
Member Author

multiple updates on this one:

  • The languages of the modules are now based on the same structure as the SEPAL one (I18n sepal_ui#394)
  • we use a pontoon instance to translate the projects (https://sepal-ui-translation.herokuapp.com)
  • multiple issues are opened on sepal_ui to improve language support (subvariety of langs, multiple key files...)

I tried to get the language stored in LocalStorage but as JS is asynchronous I cannot get it when using a voila based App (davidbrochart/ipyurl#2 (comment))

@12rambau
Copy link
Member Author

We ended up creating a config file for sepal_ui based applications (openforis/sepal_ui#413). I don't know why we didn't think about that earlier and it works quite well. now it's just a matter of upgrading applications venvs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant