Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/desktop/src/i18n/catalog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { en } from './en'
import { ja } from './ja'
import { ptBr } from './pt-br'
import type { Locale, Translations } from './types'
import { zh } from './zh'
import { zhHant } from './zh-hant'
Expand All @@ -8,5 +9,6 @@ export const TRANSLATIONS: Record<Locale, Translations> = {
en,
zh,
'zh-hant': zhHant,
ja
ja,
'pt-br': ptBr
}
13 changes: 12 additions & 1 deletion apps/desktop/src/i18n/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export const LOCALE_OPTIONS = [
name: '日本語',
englishName: 'Japanese',
configValue: 'ja'
},
{
id: 'pt-br',
name: 'Português (Brasil)',
englishName: 'Portuguese (Brazil)',
configValue: 'pt-br'
}
] as const satisfies readonly { configValue: string; englishName: string; id: Locale; name: string }[]

Expand Down Expand Up @@ -64,7 +70,12 @@ const LOCALE_ALIASES: Record<string, Locale> = {
zh_hant_hk: 'zh-hant',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add regression coverage for the new pt, pt-BR, and pt_br normalization paths. The existing alias contract is tested in languages.test.ts, but this PR does not extend it.

ja: 'ja',
'ja-jp': 'ja',
ja_jp: 'ja'
ja_jp: 'ja',
'pt-br': 'pt-br',
pt_br: 'pt-br',
pt: 'pt-br',
'pt-BR': 'pt-br',
pt_BR: 'pt-br'
}

export function isLocale(value: unknown): value is Locale {
Expand Down
Loading