-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve internal naming and reporting of locale
There are three categories of language reference set. 1. Those that are installed, and recognised as matching a locale. "available" 2. Those that are installed, but not recognised. "unrecognised" 3. Those that are not installed. In order to improve the internal language module, this renames important private functions to better describe their function (e.g. available-language-reference-sets instead of installed-language-reference-sets). In addition, Hermes currently provides guarantees that there will always be a fallback set of language reference sets so that we can always determine at least one preferred synonym, for example. This means Hermes has to check that the fallback (default) locale can be met with the reference sets that have been installed. In the event of not meeting this requirement, Hermes fails fast, rather than waiting until runtime. This commit improves that error reporting. The alternative is to give a warning, or log an error, but continue, perhaps using one of the known installed language reference sets, and only to fail if that fallback fails. For now, this maintains the fail-fast no magic fallback option, but a fallback, particularly if the user has not explicitly chosen a locale, but we've the system default locale, might be a better option.
- Loading branch information
Showing
2 changed files
with
45 additions
and
39 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