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

load translation override using backend #4324

Closed
wants to merge 3 commits into from

Conversation

zoran995
Copy link
Collaborator

@zoran995 zoran995 commented May 18, 2020

What this PR does

I decided to break commit #4227 into smaller parts since something like eslint will take a long time to completely configure. The basic idea is described in #4280 (comment)
Adds an option for overriding the translation files from TerriaMap. This provides the user with the ability to

  • define language configuration inside TerriaMap config file.
  • put a language overrides to file wwwroot/Language/{{lng}}/languageOverrides.json, {{lng}} is a short name for the language. If the language that user is looking for is not officially supported by Terria, he should specify also create a translation.json to avoid 404 not found error in console. Reason for this is in i18next backend default behaviour to try to load every namespace that is not already loaded.
  • tests are updated and should be correct (at least they are on my computer) to support the removing of i18.js from prerequisites.js. Tests now use cimode language option which returns the translation key, it is defined to run beforeEach test so it is not necessary to call it for all tests.

global internationalization track in #3785

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist) - I am not sure how to test this
  • I've updated CHANGES.md with what I changed.

@zoran995 zoran995 mentioned this pull request Jun 4, 2020
2 tasks
@zoran995
Copy link
Collaborator Author

zoran995 commented Jul 7, 2020

One idea is to use this as an option to enable internationalization of the help and trainer content (if it proves to be possible to handle all use cases hope to have it by end of the week)

@zoran995 zoran995 mentioned this pull request Jul 8, 2020
2 tasks
@soyarsauce
Copy link
Contributor

This should go some of the way to addressing https://github.com/TerriaJS/nsw-digital-twin/issues/425

@zoran995
Copy link
Collaborator Author

implemented in #4523

@zoran995 zoran995 closed this Sep 10, 2020
@zoran995 zoran995 deleted the i18n-config-new branch September 10, 2020 21:48
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

Successfully merging this pull request may close these issues.

2 participants