feat(lang): add Hindi Desktop locale (#9733)
Signed-off-by: Abhijay Jain <Abhijay007j@gmail.com>
This commit is contained in:
@@ -73,6 +73,17 @@ describe('getLocale', () => {
|
||||
expect(getLocale()).toEqual({ locale: 'tr', messageLocale: 'tr' });
|
||||
});
|
||||
|
||||
it('supports Hindi from navigator.languages', () => {
|
||||
vi.stubGlobal('navigator', { languages: ['hi-IN'] });
|
||||
expect(getLocale()).toEqual({ locale: 'hi-IN', messageLocale: 'hi' });
|
||||
});
|
||||
|
||||
it('supports explicit Hindi locale', () => {
|
||||
mockAppConfig({ GOOSE_LOCALE: 'hi' });
|
||||
vi.stubGlobal('navigator', { languages: ['xx-XX'] });
|
||||
expect(getLocale()).toEqual({ locale: 'hi', messageLocale: 'hi' });
|
||||
});
|
||||
|
||||
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-' });
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
export { defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
/** The set of locales that have translation catalogs. */
|
||||
const SUPPORTED_LOCALES = new Set(['en', 'ru', 'tr', 'zh-CN']);
|
||||
const SUPPORTED_LOCALES = new Set(['en', 'hi', 'ru', '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
Reference in New Issue
Block a user