Special case English translation fallback
We should not be listing this in LINGUAS as that gives the impression
that English has en explicit translation. Instead, it is a special case
that the code needs to be explicitly aware of.
This reverts 9a06058 in favour of a more robust fix.
This commit is contained in:
@@ -27,6 +27,16 @@ describe('Localization', function () {
|
||||
l10n.setup(["es", "fr"]);
|
||||
expect(l10n.language).to.equal('en');
|
||||
});
|
||||
it('should fall back to generic English for other English', function () {
|
||||
window.navigator.languages = ["en-AU", "de"];
|
||||
l10n.setup(["de", "fr", "en-GB"]);
|
||||
expect(l10n.language).to.equal('en');
|
||||
});
|
||||
it('should prefer specific English over generic', function () {
|
||||
window.navigator.languages = ["en-GB", "de"];
|
||||
l10n.setup(["de", "en-AU", "en-GB"]);
|
||||
expect(l10n.language).to.equal('en-GB');
|
||||
});
|
||||
it('should use the most preferred user language', function () {
|
||||
window.navigator.languages = ["nl", "de", "fr"];
|
||||
l10n.setup(["es", "fr", "de"]);
|
||||
|
||||
Reference in New Issue
Block a user