Skip to content

Commit

Permalink
Fix Nepali language code (bluesky-social#7265)
Browse files Browse the repository at this point in the history
* Replace `np` with `ne`

* Reorder
  • Loading branch information
quiple authored Dec 24, 2024
1 parent 2b28c85 commit f05962a
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ module.exports = function (config) {
'ja',
'km',
'ko',
'ne',
'nl',
'np',
'pl',
'pt-BR',
'ro',
Expand Down
2 changes: 1 addition & 1 deletion lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module.exports = {
'ja',
'km',
'ko',
'ne',
'nl',
'np',
'pl',
'pt-BR',
'ro',
Expand Down
2 changes: 1 addition & 1 deletion src/components/hooks/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const locales: Record<AppLanguage, Locale | undefined> = {
ja,
km,
ko,
ne: undefined,
nl,
np: undefined,
pl,
['pt-BR']: ptBR,
ro,
Expand Down
2 changes: 1 addition & 1 deletion src/locale/__tests__/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +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)
expect(sanitizeAppLanguageSetting('ne')).toBe(AppLanguage.ne)
})
4 changes: 2 additions & 2 deletions src/locale/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.km
case 'ko':
return AppLanguage.ko
case 'ne':
return AppLanguage.ne
case 'nl':
return AppLanguage.nl
case 'np':
return AppLanguage.np
case 'pl':
return AppLanguage.pl
case 'pt-BR':
Expand Down
10 changes: 5 additions & 5 deletions src/locale/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ 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 messagesNe} from '#/locale/locales/ne/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 @@ -185,6 +185,10 @@ export async function dynamicActivate(locale: AppLanguage) {
])
break
}
case AppLanguage.ne: {
i18n.loadAndActivate({locale, messages: messagesNe})
break
}
case AppLanguage.nl: {
i18n.loadAndActivate({locale, messages: messagesNl})
await Promise.all([
Expand All @@ -193,10 +197,6 @@ 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
8 changes: 4 additions & 4 deletions src/locale/i18n.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/ko/messages`)
break
}
case AppLanguage.nl: {
mod = await import(`./locales/nl/messages`)
case AppLanguage.ne: {
mod = await import(`./locales/ne/messages`)
break
}
case AppLanguage.np: {
mod = await import(`./locales/np/messages`)
case AppLanguage.nl: {
mod = await import(`./locales/nl/messages`)
break
}
case AppLanguage.pl: {
Expand Down
4 changes: 2 additions & 2 deletions src/locale/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export enum AppLanguage {
ja = 'ja',
km = 'km',
ko = 'ko',
ne = 'ne',
nl = 'nl',
np = 'np',
pl = 'pl',
pt_BR = 'pt-BR',
ro = 'ro',
Expand Down Expand Up @@ -62,8 +62,8 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.ja, name: '日本語 – Japanese'},
{code2: AppLanguage.km, name: 'ភាសាខ្មែរ – Khmer'},
{code2: AppLanguage.ko, name: '한국어 – Korean'},
{code2: AppLanguage.ne, name: 'नेपाली – Nepali'},
{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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: np\n"
"Language: ne\n"
"Project-Id-Version: Nepali localization for bluesky-social-app\n"
"Report-Msgid-Bugs-To: Divyaswor Makai Shrestha <[email protected]>\n"
"PO-Revision-Date: \n"
Expand Down

0 comments on commit f05962a

Please sign in to comment.