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

Add i18n support with i18next #25

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

attemoi
Copy link
Contributor

@attemoi attemoi commented Apr 16, 2024

Adds the necessary libraries and tooling needed for i18n.

For tests, the i18n-react library is mocked and helper methods are added to include the extra (mocked) props where needed.

To extract translations from sources, use the new i18n-extract script:

npm run i18n-extract

Motivation and Context

https://jira.lingsoft.fi/browse/SIMPLYE-301 - Add the translation support to the Circulation Admin

Checklist:

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@attemoi attemoi force-pushed the feature/simplye-301/i18n branch 3 times, most recently from d4170c7 to ddd5d5c Compare April 18, 2024 06:04
Added the necessary libraries and tooling needed for i18n.

A new script added for extracting translations:

```
npm run i18n-extract
```
@attemoi attemoi force-pushed the feature/simplye-301/i18n branch from ddd5d5c to ed45827 Compare April 29, 2024 08:36
attemoi and others added 3 commits April 29, 2024 11:37
@ttuovinen ttuovinen force-pushed the feature/simplye-301/i18n branch from be43fed to b0f854f Compare June 6, 2024 19:40
@ttuovinen
Copy link
Contributor

ttuovinen commented Jun 7, 2024

I've added replaced the web-opds-client with @naltibfi/ekirjasto-web-opds-client. Now backend calls should have Accept-language header so that the backend-translated strings would be in corresponding language.

There's a rudimentary language switcher added to Header component. Note that there's no yet translations for fi and sv so english is used as a fallback for all texts (except for those that have translations in backend).

Instructions for translation extraction, export and import can be found in README.

Note: at this point there's some translations still missing, mainly from Tilastot-section and some of the forms. Feel free to continue the work!

@ttuovinen ttuovinen marked this pull request as ready for review June 7, 2024 06:31
@ttuovinen ttuovinen requested a review from a team June 7, 2024 06:44
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.

3 participants