Add Indonesian localization (#2356)

* Add Indonesian (id) locale

* Add Indonesian translation messages

* Update team number and add some translation

* Update for better ID translation

* Apply suggestions from code review

Co-authored-by: Aditya Dirgantara <ccoremapd@icloud.com>
Co-authored-by: Mary <148872143+mary-ext@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Aditya Dirgantara <ccoremapd@icloud.com>

* Apply suggestions from code review

Co-authored-by: Mary <148872143+mary-ext@users.noreply.github.com>

* Change translation post to postingan

* Update translation

* Fix error

* Apply suggestions from code review

Co-authored-by: Mary <148872143+mary-ext@users.noreply.github.com>

* Add Thinkbyte1024 and mary-ext to language team ID

* Update username to lowercase

---------

Co-authored-by: Aditya Dirgantara <ccoremapd@icloud.com>
Co-authored-by: Mary <148872143+mary-ext@users.noreply.github.com>
Co-authored-by: Ansh <anshnanda10@gmail.com>
zio/stable
Danni 2024-01-10 03:47:48 +07:00 committed by GitHub
parent dda5ca27fe
commit d7f4e1391c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 2493 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/** @type {import('@lingui/conf').LinguiConfig} */ /** @type {import('@lingui/conf').LinguiConfig} */
module.exports = { module.exports = {
locales: ['en', 'hi', 'ja', 'fr', 'de', 'es', 'ko', 'es', 'pt-BR', 'uk'], locales: ['en', 'hi', 'ja', 'fr', 'de', 'es', 'ko', 'es', 'pt-BR', 'uk', 'id'],
catalogs: [ catalogs: [
{ {
path: '<rootDir>/src/locale/locales/{locale}/messages', path: '<rootDir>/src/locale/locales/{locale}/messages',

View File

@ -7,6 +7,7 @@ test('sanitizeAppLanguageSetting', () => {
expect(sanitizeAppLanguageSetting('en')).toBe(AppLanguage.en) expect(sanitizeAppLanguageSetting('en')).toBe(AppLanguage.en)
expect(sanitizeAppLanguageSetting('pt-BR')).toBe(AppLanguage.pt_BR) expect(sanitizeAppLanguageSetting('pt-BR')).toBe(AppLanguage.pt_BR)
expect(sanitizeAppLanguageSetting('hi')).toBe(AppLanguage.hi) expect(sanitizeAppLanguageSetting('hi')).toBe(AppLanguage.hi)
expect(sanitizeAppLanguageSetting('id')).toBe(AppLanguage.id)
expect(sanitizeAppLanguageSetting('foo')).toBe(AppLanguage.en) expect(sanitizeAppLanguageSetting('foo')).toBe(AppLanguage.en)
expect(sanitizeAppLanguageSetting('en,foo')).toBe(AppLanguage.en) expect(sanitizeAppLanguageSetting('en,foo')).toBe(AppLanguage.en)
expect(sanitizeAppLanguageSetting('foo,en')).toBe(AppLanguage.en) expect(sanitizeAppLanguageSetting('foo,en')).toBe(AppLanguage.en)

View File

@ -113,7 +113,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
// DISABLED until this translation is fixed -prf // DISABLED until this translation is fixed -prf
// case 'de': // case 'de':
// return AppLanguage.de // return AppLanguage.de
// DISABLED until this translation is more thoroughly reviewed -prf case 'id':
return AppLanguage.id
case 'es': case 'es':
return AppLanguage.es return AppLanguage.es
case 'fr': case 'fr':
@ -132,6 +133,5 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
continue continue
} }
} }
return AppLanguage.en return AppLanguage.en
} }

View File

@ -5,6 +5,7 @@ import {useLanguagePrefs} from '#/state/preferences'
import {messages as messagesEn} from '#/locale/locales/en/messages' import {messages as messagesEn} from '#/locale/locales/en/messages'
// DISABLED until this translation is fixed -prf // DISABLED until this translation is fixed -prf
// import {messages as messagesDe} from '#/locale/locales/de/messages' // import {messages as messagesDe} from '#/locale/locales/de/messages'
import {messages as messagesId} from '#/locale/locales/id/messages'
import {messages as messagesEs} from '#/locale/locales/es/messages' import {messages as messagesEs} from '#/locale/locales/es/messages'
import {messages as messagesFr} from '#/locale/locales/fr/messages' import {messages as messagesFr} from '#/locale/locales/fr/messages'
import {messages as messagesHi} from '#/locale/locales/hi/messages' import {messages as messagesHi} from '#/locale/locales/hi/messages'
@ -26,6 +27,10 @@ export async function dynamicActivate(locale: AppLanguage) {
// i18n.loadAndActivate({locale, messages: messagesDe}) // i18n.loadAndActivate({locale, messages: messagesDe})
// break // break
// } // }
case AppLanguage.id: {
i18n.loadAndActivate({locale, messages: messagesId})
break
}
case AppLanguage.es: { case AppLanguage.es: {
i18n.loadAndActivate({locale, messages: messagesEs}) i18n.loadAndActivate({locale, messages: messagesEs})
break break

View File

@ -17,6 +17,10 @@ export async function dynamicActivate(locale: AppLanguage) {
// mod = await import(`./locales/de/messages`) // mod = await import(`./locales/de/messages`)
// break // break
// } // }
case AppLanguage.id: {
mod = await import(`./locales/id/messages`)
break
}
case AppLanguage.es: { case AppLanguage.es: {
mod = await import(`./locales/es/messages`) mod = await import(`./locales/es/messages`)
break break

View File

@ -8,6 +8,7 @@ export enum AppLanguage {
en = 'en', en = 'en',
// DISABLED until this translation is fixed -prf // DISABLED until this translation is fixed -prf
// de = 'de', // de = 'de',
id = 'id',
es = 'es', es = 'es',
fr = 'fr', fr = 'fr',
hi = 'hi', hi = 'hi',
@ -26,6 +27,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.en, name: 'English'}, {code2: AppLanguage.en, name: 'English'},
// DISABLED until this translation is fixed -prf // DISABLED until this translation is fixed -prf
// {code2: AppLanguage.de, name: 'Deutsch'}, // {code2: AppLanguage.de, name: 'Deutsch'},
{code2: AppLanguage.id, name: 'Indonesian'},
{code2: AppLanguage.es, name: 'Español'}, {code2: AppLanguage.es, name: 'Español'},
{code2: AppLanguage.fr, name: 'Français'}, {code2: AppLanguage.fr, name: 'Français'},
{code2: AppLanguage.hi, name: 'हिंदी'}, {code2: AppLanguage.hi, name: 'हिंदी'},

File diff suppressed because it is too large Load Diff