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

Changes of i18next config #4227

Closed
wants to merge 3 commits into from
Closed

Conversation

zoran995
Copy link
Collaborator

What this PR does

This is just a draft of some updates for i18next configuration, but it would be nice to discuss them.
This introduces

  • Ability for the user to define which languages should be used and fallback language in TerriaMap config file (if not defined default values used). This should replace the instance of i18n.js file (used in prerequisites).
  • Introduces usage of i18next-xhr-backend so language files get pulled from the backend (this will require exposing Languages so a browser can access them). More info about it here.
  • Introduces dev-dependency eslint-plugin-i18next. This should wait for changes from this pull request. This would be useful to detect hard-coded strings. Needs a lot of work to separate all strings that should not be detected as hard-coded (currently detects over 1k of problems). Currently works only on .js and .jsx files, to make it work for .ts files Model architecture: Enable eslint for .ts files #3303 is needed.

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've updated CHANGES.md with what I changed.

@soyarsauce
Copy link
Contributor

Just a quick note - I had a quick go at implementing a super lightweight usage of something similar to this PR, and saw i18next-xhr-backend is deprecated - i18next-http-backend (https://github.com/i18next/i18next-http-backend) is the favoured lib now, except it is still early days for it as I ran into some problems with using the options as they are developed out.

@zoran995
Copy link
Collaborator Author

zoran995 commented Jun 4, 2020

loading translations override from backend is moved to #4324, with the usage of i18next-http-backend

@zoran995 zoran995 mentioned this pull request Jul 7, 2020
2 tasks
@zoran995
Copy link
Collaborator Author

I think this is suppersed by #4519, while other parts are already implemented

@zoran995 zoran995 closed this Jun 15, 2021
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