Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
1 change: 1 addition & 0 deletions crates/services/src/services/config/versions/v6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub enum UiLanguage {
Ko, // Force Korean
ZhHans, // Force Simplified Chinese
ZhHant, // Force Traditional Chinese
Pt, // Portuguese
Comment thread
pedrotecinf marked this conversation as resolved.
}

#[derive(Clone, Debug, Serialize, Deserialize, TS)]
Expand Down
16 changes: 15 additions & 1 deletion packages/web-core/src/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ import esSettings from './locales/es/settings.json';
import esProjects from './locales/es/projects.json';
import esTasks from './locales/es/tasks.json';
import esOrganization from './locales/es/organization.json';
import ptCommon from './locales/pt/common.json';
import ptSettings from './locales/pt/settings.json';
import ptProjects from './locales/pt/projects.json';
import ptTasks from './locales/pt/tasks.json';
import ptOrganization from './locales/pt/organization.json';
import koCommon from './locales/ko/common.json';
import koSettings from './locales/ko/settings.json';
import koProjects from './locales/ko/projects.json';
Expand Down Expand Up @@ -69,6 +74,13 @@ const resources = {
tasks: esTasks,
organization: esOrganization,
},
pt: {
common: ptCommon,
settings: ptSettings,
projects: ptProjects,
tasks: ptTasks,
organization: ptOrganization,
},
ko: {
common: koCommon,
settings: koSettings,
Expand Down Expand Up @@ -98,6 +110,8 @@ i18n
.init({
resources,
fallbackLng: {
'pt-BR': ['pt'],
'pt-PT': ['pt'],
'zh-TW': ['zh-Hant'],
'zh-HK': ['zh-Hant'],
'zh-MO': ['zh-Hant'],
Expand All @@ -107,7 +121,7 @@ i18n
defaultNS: 'common',
debug: import.meta.env.DEV,
// Include 'zh' + Traditional Chinese locales for browser detection
supportedLngs: [...SUPPORTED_I18N_CODES, 'zh', 'zh-TW', 'zh-HK', 'zh-MO'],
supportedLngs: [...SUPPORTED_I18N_CODES, 'zh', 'zh-TW', 'zh-HK', 'zh-MO', 'pt-BR', 'pt-PT'],
nonExplicitSupportedLngs: true, // Accept zh -> zh-Hans mapping
load: 'currentOnly', // Load exact language code

Expand Down
3 changes: 3 additions & 0 deletions packages/web-core/src/i18n/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const UI_TO_I18N = {
FR: 'fr',
JA: 'ja',
ES: 'es',
PT: 'pt',
KO: 'ko',
ZH_HANS: 'zh-Hans',
ZH_HANT: 'zh-Hant',
Expand All @@ -20,6 +21,7 @@ const SUPPORTED_UI_LANGUAGES = [
'FR',
'JA',
'ES',
'PT',
'KO',
'ZH_HANS',
'ZH_HANT',
Expand All @@ -31,6 +33,7 @@ const FALLBACK_ENDONYMS = {
fr: 'Français',
ja: '日本語',
es: 'Español',
pt: 'Português',
ko: '한국어',
'zh-Hans': '简体中文',
'zh-Hant': '繁體中文',
Expand Down
Loading