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

localization #115

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

localization #115

wants to merge 17 commits into from

Conversation

DaveDarsa
Copy link
Contributor

No description provided.

@DaveDarsa DaveDarsa changed the title basic integration localization Apr 5, 2023
@DaveDarsa DaveDarsa added the enhancement New feature or request label Apr 5, 2023
@DaveDarsa DaveDarsa marked this pull request as ready for review April 12, 2023 15:29
@DaveDarsa
Copy link
Contributor Author

DaveDarsa commented Apr 12, 2023

@tobybellwood @CGoodwin90 @bomoko @shreddedbacon @timclifford whenever we need translated content on the page in the future we should import the useTranslation hook from lib/useTranslation.tsx

the i18n library first detects the user language and if it's one of the languages we support, content is shown in that language, otherwise it defaults to English.

user's language is cached in localstorage and also saved a cookie.

it would be nice to discuss how we handle contributions, as the translation dictionary is saved in i18n/dictionary.json.

currently I only added content for English, and whenever we have translations for any language we need to support, this dictionry.json file needs to be modified with new language translation strings.

It is configured to just support English and Italian for now, but since there are no translated strings in Italian, language lookup namespace defaults to en as defined in the i18n.ts file, so all the missing keys are replaced with English content.

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

Successfully merging this pull request may close these issues.

1 participant