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

Improve localization features #5

Open
francamps opened this issue Oct 29, 2018 · 4 comments
Open

Improve localization features #5

francamps opened this issue Oct 29, 2018 · 4 comments
Labels
enhancement New feature or request help wanted Open for community contribution! Be sure to comment on the issue to check status

Comments

@francamps
Copy link
Contributor

Map2d currently has some localization features. src/js/copy.json is thought of as a localization device that contains all translations. It contains the interface copy text as well as dictionaries for recurrent words in the data served by the server. Components default to English (en-US), but can allow toggling between different languages.

{
  "es-MX": {
       "loading": "Cargando...",
       "legend": {

       },
       "toolbar": {

       },
       "other stuff": {

       }
   },
   "en-US": {

   }
}

Additionally, src/js/es-MX.json is an additional file that contains sets of property labels localized in a particular language (in this case, es-MX, Mexican Spanish). Note that this file is named exactly like the language codes available in copy.json.

Toolbar.jsx should contain a button that switches between the available languages in the Redux store, which align coincide with the languages available in copy.json. Note that in the Redux store (src/store/initial.js) you'll find the language code in app.language, which defaults to en-US.

@francamps francamps added enhancement New feature or request help wanted Open for community contribution! Be sure to comment on the issue to check status labels Oct 29, 2018
@francamps
Copy link
Contributor Author

As it is, the application does not currently support RTL languages. Check #6.

@jlieb10
Copy link

jlieb10 commented Nov 29, 2018

@francamps Could you help me understand what is wrong with the code that has been commented out? The toggle seems to be working for me after I uncomment the relevant code in Toolbar.jsx

@francamps
Copy link
Contributor Author

@jlieb10 It's possible that it works well but some aspects of it are a little bespoke and we decided to hide the feature until we have time to develop a more standard solution which could include more languages and also RTL.

@breezykermo
Copy link
Member

@1cgonza this might be helpful if you are looking to make a PR with your Spanish localizations :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Open for community contribution! Be sure to comment on the issue to check status
Projects
None yet
Development

No branches or pull requests

3 participants