Skip to content

Commit

Permalink
Add Khmer Localization (#6914)
Browse files Browse the repository at this point in the history
* add khmer language

* update translate

* update translate

* add missing localization key

* update khmer wording

* update khmer wording

* add missing translate

* add missing translate

* chore: add khmer local date-time format

* Update src/locale/i18n.ts

Co-authored-by: surfdude29 <[email protected]>

---------

Co-authored-by: Paul Frazee <[email protected]>
Co-authored-by: surfdude29 <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2024
1 parent 9b35521 commit 323c974
Show file tree
Hide file tree
Showing 8 changed files with 8,639 additions and 0 deletions.
1 change: 1 addition & 0 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ module.exports = function (config) {
'id',
'it',
'ja',
'km',
'ko',
'nl',
'pl',
Expand Down
1 change: 1 addition & 0 deletions lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
'id',
'it',
'ja',
'km',
'ko',
'nl',
'pl',
Expand Down
2 changes: 2 additions & 0 deletions src/components/hooks/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
id,
it,
ja,
km,
ko,
nl,
pl,
Expand Down Expand Up @@ -60,6 +61,7 @@ const locales: Record<AppLanguage, Locale | undefined> = {
id,
it,
ja,
km,
ko,
nl,
pl,
Expand Down
2 changes: 2 additions & 0 deletions src/locale/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.it
case 'ja':
return AppLanguage.ja
case 'km':
return AppLanguage.km
case 'ko':
return AppLanguage.ko
case 'nl':
Expand Down
11 changes: 11 additions & 0 deletions src/locale/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {messages as messagesHu} from '#/locale/locales/hu/messages'
import {messages as messagesId} from '#/locale/locales/id/messages'
import {messages as messagesIt} from '#/locale/locales/it/messages'
import {messages as messagesJa} from '#/locale/locales/ja/messages'
import {messages as messagesKm} from '#/locale/locales/km/messages'
import {messages as messagesKo} from '#/locale/locales/ko/messages'
import {messages as messagesNl} from '#/locale/locales/nl/messages'
import {messages as messagesPl} from '#/locale/locales/pl/messages'
Expand Down Expand Up @@ -184,6 +185,16 @@ export async function dynamicActivate(locale: AppLanguage) {
])
break
}
case AppLanguage.km: {
i18n.loadAndActivate({locale, messages: messagesKm})
await Promise.all([
import('@formatjs/intl-datetimeformat/locale-data/km'),
import('@formatjs/intl-datetimeformat/locale-data/km'),
import('@formatjs/intl-pluralrules/locale-data/km'),
import('@formatjs/intl-numberformat/locale-data/km'),
])
break
}
case AppLanguage.ko: {
i18n.loadAndActivate({locale, messages: messagesKo})
await Promise.all([
Expand Down
4 changes: 4 additions & 0 deletions src/locale/i18n.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/ja/messages`)
break
}
case AppLanguage.km: {
mod = await import(`./locales/km/messages`)
break
}
case AppLanguage.ko: {
mod = await import(`./locales/ko/messages`)
break
Expand Down
2 changes: 2 additions & 0 deletions src/locale/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum AppLanguage {
id = 'id',
it = 'it',
ja = 'ja',
km = 'km',
ko = 'ko',
nl = 'nl',
pl = 'pl',
Expand Down Expand Up @@ -58,6 +59,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.id, name: 'Bahasa Indonesia – Indonesian'},
{code2: AppLanguage.it, name: 'Italiano – Italian'},
{code2: AppLanguage.ja, name: '日本語 – Japanese'},
{code2: AppLanguage.km, name: 'ភាសាខ្មែរ – Khmer'},
{code2: AppLanguage.ko, name: '한국어 – Korean'},
{code2: AppLanguage.nl, name: 'Nederlands – Dutch'},
{code2: AppLanguage.pl, name: 'Polski – Polish'},
Expand Down
Loading

0 comments on commit 323c974

Please sign in to comment.