Add Turkish desktop locale (#9392)

Signed-off-by: dejavu <dejavu@Mac.home>
Co-authored-by: dejavu <dejavu@Mac.home>
This commit is contained in:
seneroner77-cmd
2026-05-26 18:53:19 +03:00
committed by GitHub
parent 6d544e7b55
commit bf0da953d5
3 changed files with 4823 additions and 1 deletions
+11
View File
@@ -52,6 +52,17 @@ describe('getLocale', () => {
expect(getLocale()).toEqual({ locale: 'en-GB', messageLocale: 'en' });
});
it('supports Turkish from navigator.languages', () => {
vi.stubGlobal('navigator', { languages: ['tr-TR'] });
expect(getLocale()).toEqual({ locale: 'tr-TR', messageLocale: 'tr' });
});
it('supports explicit Turkish locale', () => {
mockAppConfig({ GOOSE_LOCALE: 'tr' });
vi.stubGlobal('navigator', { languages: ['xx-XX'] });
expect(getLocale()).toEqual({ locale: 'tr', messageLocale: 'tr' });
});
it('falls back to base language when locale tag is invalid BCP 47', () => {
// "en-" is not a valid BCP 47 tag and would cause RangeError in Intl APIs
mockAppConfig({ GOOSE_LOCALE: 'en-' });
+1 -1
View File
@@ -15,7 +15,7 @@
export { defineMessages, useIntl } from 'react-intl';
/** The set of locales that have translation catalogs. */
const SUPPORTED_LOCALES = new Set(['en', 'zh-CN']);
const SUPPORTED_LOCALES = new Set(['en', 'tr', 'zh-CN']);
/**
* Map Simplified Chinese aliases (zh, zh-Hans*, zh-SG, zh-MY) to "zh-CN".
File diff suppressed because it is too large Load Diff