Skip to content

Commit

Permalink
Nepali Translation (divyaswormakai's reviewed & some changes) (#7033)
Browse files Browse the repository at this point in the history
* feat: prepare necesaary files

* fix: message file for nepali translation

* feat: language file update

* feat: add missing pieces

* feat: one and other updates

* additional changes

---------

Co-authored-by: Divyaswor Makai <[email protected]>
  • Loading branch information
whoisanku and divyaswormakai authored Dec 18, 2024
1 parent 0e7ad19 commit bdae89b
Show file tree
Hide file tree
Showing 9 changed files with 9,109 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 @@ -90,6 +90,7 @@ module.exports = function (config) {
'km',
'ko',
'nl',
'np',
'pl',
'pt-BR',
'ro',
Expand Down
1 change: 1 addition & 0 deletions lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
'km',
'ko',
'nl',
'np',
'pl',
'pt-BR',
'ro',
Expand Down
1 change: 1 addition & 0 deletions src/components/hooks/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const locales: Record<AppLanguage, Locale | undefined> = {
km,
ko,
nl,
np: undefined,
pl,
['pt-BR']: ptBR,
ro,
Expand Down
1 change: 1 addition & 0 deletions src/locale/__tests__/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ test('sanitizeAppLanguageSetting', () => {
expect(sanitizeAppLanguageSetting('en,foo')).toBe(AppLanguage.en)
expect(sanitizeAppLanguageSetting('foo,en')).toBe(AppLanguage.en)
expect(sanitizeAppLanguageSetting('vi')).toBe(AppLanguage.vi)
expect(sanitizeAppLanguageSetting('np')).toBe(AppLanguage.np)
})
2 changes: 2 additions & 0 deletions src/locale/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.ko
case 'nl':
return AppLanguage.nl
case 'np':
return AppLanguage.np
case 'pl':
return AppLanguage.pl
case 'pt-BR':
Expand Down
5 changes: 5 additions & 0 deletions src/locale/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ 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 messagesNp} from '#/locale/locales/np/messages'
import {messages as messagesPl} from '#/locale/locales/pl/messages'
import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages'
import {messages as messagesRo} from '#/locale/locales/ro/messages'
Expand Down Expand Up @@ -213,6 +214,10 @@ export async function dynamicActivate(locale: AppLanguage) {
])
break
}
case AppLanguage.np: {
i18n.loadAndActivate({locale, messages: messagesNp})
break
}
case AppLanguage.pl: {
i18n.loadAndActivate({locale, messages: messagesPl})
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 @@ -84,6 +84,10 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/nl/messages`)
break
}
case AppLanguage.np: {
mod = await import(`./locales/np/messages`)
break
}
case AppLanguage.pl: {
mod = await import(`./locales/pl/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 @@ -24,6 +24,7 @@ export enum AppLanguage {
km = 'km',
ko = 'ko',
nl = 'nl',
np = 'np',
pl = 'pl',
pt_BR = 'pt-BR',
ro = 'ro',
Expand Down Expand Up @@ -62,6 +63,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.km, name: 'ភាសាខ្មែរ – Khmer'},
{code2: AppLanguage.ko, name: '한국어 – Korean'},
{code2: AppLanguage.nl, name: 'Nederlands – Dutch'},
{code2: AppLanguage.np, name: 'नेपाली – Nepali'},
{code2: AppLanguage.pl, name: 'Polski – Polish'},
{code2: AppLanguage.pt_BR, name: 'Português (BR) – Portuguese (BR)'},
{code2: AppLanguage.ro, name: 'Română – Romanian'},
Expand Down
9,092 changes: 9,092 additions & 0 deletions src/locale/locales/np/messages.po

Large diffs are not rendered by default.

0 comments on commit bdae89b

Please sign in to comment.