forked from tektoncd/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalise stored locale and add support for dev override
Normalise the stored locale to match the values we use to reference our string bundles, e.g. `zh-TW` will be stored as `zh-Hant`. This mapping can be extended in future to handle additional conversion if required, e.g. `en-US` -> `en` or `en-AU` -> `en-GB` For now if an exact match isn't found, a fallback search is performed by dropping the region/script portion and comparing the language subtag against supported locales, e.g. `zh-SG` would match `zh`. For development purposes, the list of supported locales can be overridden to expose all built locales by adding a known key to the browser's `localStorage`. The application will then match the browser language setting against all built locales allowing for easy dev / test without having to modify the locale handling or message bundle loading code.: `localStorage.setItem('tkn-locale-dev', true);` and `localStorage.removeItem('tkn-locale-dev');`
- Loading branch information
1 parent
248053b
commit 85108db
Showing
6 changed files
with
105 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters