i18n Internationalization starter setup #190
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this do?
Implements some initial
i18n
patterns for how to define and use internationalization in Clover. This approach uses the React flavor of the i18Next package.Directory structure
/src/i18n
config.ts
- Root config file/@types
- Support for Typescript[language here]
- i.e.en
,de
, etc..json
files can live here, which name space the different Clover exports? i.e.viewer.json
,common.json
,bloom.json
, etc...How it works
Pull in the configuration by importing
confg.ts
into a top level file.Then use translations in a component like so:
Notes
To enable Typescript support (type checking and autocomplete), this file will have to be accurate, and stay in sync with the directory structures:
Currently
en
is configured to be the default, but asi18n
becomes more populated there is anLanguageDetector
we can eventually pull into initial configuration.