Files
orca/src/shared/ui-language.test.ts
T
+4 ae64a215a3 Add Brazilian Portuguese UI localization (#31627)
* feat(i18n): add Brazilian Portuguese

* feat(i18n): migrate legacy Portuguese plugin preferences once

Co-authored-by: Jackson Florencio <120382485+Jackson-Florencio@users.noreply.github.com>
Co-authored-by: joaoguilhermesimon-collab <245094637+joaoguilhermesimon-collab@users.noreply.github.com>
Co-authored-by: heslanx <167841364+heslanx@users.noreply.github.com>
Co-authored-by: Janderson Fagner <135186779+janderson-fagner@users.noreply.github.com>
Co-authored-by: Carlos <141033701+eusoucarlosmedeiros@users.noreply.github.com>
Co-authored-by: João Messias Lima Pereira <41351492+joaorura@users.noreply.github.com>
Co-authored-by: oliveiraleandro1981 <46854234+oliveiraleandro1981@users.noreply.github.com>
Co-authored-by: hugolrf <12834009+hugolrf@users.noreply.github.com>
Co-authored-by: Jonathan Oliveira <50607380+eojonathan@users.noreply.github.com>
Co-authored-by: Antenor e Filhos <278213917+antenorefilhos@users.noreply.github.com>
Co-authored-by: Daniel Dias <85655597+DeVFirmino@users.noreply.github.com>
Co-authored-by: Sergio Alexandre de Carvalho <65230046+salexcarvalho@users.noreply.github.com>
Co-authored-by: “Melostack” MeloX <229196278+Melostack@users.noreply.github.com>

* rm design doc

* fix(i18n): complete Brazilian Portuguese catalog

---------

Co-authored-by: Jackson Florencio <120382485+Jackson-Florencio@users.noreply.github.com>
Co-authored-by: joaoguilhermesimon-collab <245094637+joaoguilhermesimon-collab@users.noreply.github.com>
Co-authored-by: heslanx <167841364+heslanx@users.noreply.github.com>
Co-authored-by: Janderson Fagner <135186779+janderson-fagner@users.noreply.github.com>
Co-authored-by: Carlos <141033701+eusoucarlosmedeiros@users.noreply.github.com>
Co-authored-by: João Messias Lima Pereira <41351492+joaorura@users.noreply.github.com>
Co-authored-by: oliveiraleandro1981 <46854234+oliveiraleandro1981@users.noreply.github.com>
Co-authored-by: hugolrf <12834009+hugolrf@users.noreply.github.com>
Co-authored-by: Jonathan Oliveira <50607380+eojonathan@users.noreply.github.com>
Co-authored-by: Antenor e Filhos <278213917+antenorefilhos@users.noreply.github.com>
Co-authored-by: Daniel Dias <85655597+DeVFirmino@users.noreply.github.com>
Co-authored-by: Sergio Alexandre de Carvalho <65230046+salexcarvalho@users.noreply.github.com>
Co-authored-by: “Melostack” MeloX <229196278+Melostack@users.noreply.github.com>
2026-10-21 13:14:08 -07:00

32 lines
1.0 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import {
UI_LANGUAGE_CHINESE,
UI_LANGUAGE_ENGLISH,
UI_LANGUAGE_FRENCH,
UI_LANGUAGE_JAPANESE,
UI_LANGUAGE_KOREAN,
UI_LANGUAGE_PORTUGUESE,
UI_LANGUAGE_SPANISH,
UI_LANGUAGE_SYSTEM,
normalizeUiLanguage
} from './ui-language'
describe('normalizeUiLanguage', () => {
it('accepts supported language settings', () => {
expect(normalizeUiLanguage(UI_LANGUAGE_SYSTEM)).toBe('system')
expect(normalizeUiLanguage(UI_LANGUAGE_ENGLISH)).toBe('en')
expect(normalizeUiLanguage(UI_LANGUAGE_CHINESE)).toBe('zh')
expect(normalizeUiLanguage(UI_LANGUAGE_KOREAN)).toBe('ko')
expect(normalizeUiLanguage(UI_LANGUAGE_JAPANESE)).toBe('ja')
expect(normalizeUiLanguage(UI_LANGUAGE_SPANISH)).toBe('es')
expect(normalizeUiLanguage(UI_LANGUAGE_FRENCH)).toBe('fr')
expect(normalizeUiLanguage(UI_LANGUAGE_PORTUGUESE)).toBe('pt')
})
it('falls back unknown values to system', () => {
expect(normalizeUiLanguage('de')).toBe('system')
expect(normalizeUiLanguage(null)).toBe('system')
})
})