feat(lang): add Hindi Desktop locale (#9733)

Signed-off-by: Abhijay Jain <Abhijay007j@gmail.com>
This commit is contained in:
Abhijay Jain
2026-06-11 10:08:32 +05:30
committed by GitHub
parent 4207b7e080
commit db1f0fcc63
3 changed files with 4772 additions and 1 deletions
+11
View File
@@ -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-' });
+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', '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