Skip to content

Commit e248ecf

Browse files
JonatanAtilaComfy Contributor
andauthored
feat(i18n): add Portuguese (Brazil) locale (pt-BR) (#6943)
Finalmente o idioma em Portugues do Brasil verá a luz do dia (se tudo correr bem). What has been done: - Added pt-BR to .i18nrc.cjs and settings - Included loaders in src/i18n.ts and apps/desktop-ui/src/i18n.ts - Now Portuguese (BR) is displayed in the language selector - Created empty main.json, commands.json, settings.json and nodeDefs.json files to be populated by CI - Checklist: the language appears in the dropdown list, selection occurs without errors, the fallback to English, in case technical terms have no translation, is working correctly. - I will maintain the pt-br translation and review for as long as necessary. --------- Co-authored-by: Comfy Contributor <dev@example.com>
1 parent 923695f commit e248ecf

File tree

10 files changed

+27
-12
lines changed

10 files changed

+27
-12
lines changed

.i18nrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = defineConfig({
99
entry: 'src/locales/en',
1010
entryLocale: 'en',
1111
output: 'src/locales',
12-
outputLocales: ['zh', 'zh-TW', 'ru', 'ja', 'ko', 'fr', 'es', 'ar', 'tr'],
12+
outputLocales: ['zh', 'zh-TW', 'ru', 'ja', 'ko', 'fr', 'es', 'ar', 'tr', 'pt-BR'],
1313
reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade, stable zero, controlnet, lora, HiDream.
1414
'latent' is the short form of 'latent space'.
1515
'mask' is in the context of image processing.

CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@
5454

5555
# Translations
5656
/src/locales/ @Yorha4D @KarryCharon @shinshin86 @Comfy-Org/comfy_maintainer @Comfy-org/comfy_frontend_devs
57+
/src/locales/pt-BR/ @JonatanAtila @Yorha4D @KarryCharon @shinshin86
5758

5859
# LLM Instructions (blank on purpose)
5960
.claude/
6061
.cursor/
6162
.cursorrules
6263
**/AGENTS.md
63-
**/CLAUDE.md
64+
**/CLAUDE.md

apps/desktop-ui/src/components/common/LanguageSelector.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const LOCALES = [
5959
['fr', 'Français'],
6060
['es', 'Español'],
6161
['ar', 'عربي'],
62-
['tr', 'Türkçe']
62+
['tr', 'Türkçe'],
63+
['pt-BR', 'Português (BR)']
6364
] as const satisfies ReadonlyArray<[string, string]>
6465
6566
type SupportedLocale = (typeof LOCALES)[number][0]

apps/desktop-ui/src/i18n.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ const localeLoaders: Record<
4040
ru: () => import('@frontend-locales/ru/main.json'),
4141
tr: () => import('@frontend-locales/tr/main.json'),
4242
zh: () => import('@frontend-locales/zh/main.json'),
43-
'zh-TW': () => import('@frontend-locales/zh-TW/main.json')
43+
'zh-TW': () => import('@frontend-locales/zh-TW/main.json'),
44+
'pt-BR': () => import('@frontend-locales/pt-BR/main.json')
4445
}
4546

4647
const nodeDefsLoaders: Record<
@@ -55,7 +56,8 @@ const nodeDefsLoaders: Record<
5556
ru: () => import('@frontend-locales/ru/nodeDefs.json'),
5657
tr: () => import('@frontend-locales/tr/nodeDefs.json'),
5758
zh: () => import('@frontend-locales/zh/nodeDefs.json'),
58-
'zh-TW': () => import('@frontend-locales/zh-TW/nodeDefs.json')
59+
'zh-TW': () => import('@frontend-locales/zh-TW/nodeDefs.json'),
60+
'pt-BR': () => import('@frontend-locales/pt-BR/nodeDefs.json')
5961
}
6062

6163
const commandsLoaders: Record<
@@ -70,7 +72,8 @@ const commandsLoaders: Record<
7072
ru: () => import('@frontend-locales/ru/commands.json'),
7173
tr: () => import('@frontend-locales/tr/commands.json'),
7274
zh: () => import('@frontend-locales/zh/commands.json'),
73-
'zh-TW': () => import('@frontend-locales/zh-TW/commands.json')
75+
'zh-TW': () => import('@frontend-locales/zh-TW/commands.json'),
76+
'pt-BR': () => import('@frontend-locales/pt-BR/commands.json')
7477
}
7578

7679
const settingsLoaders: Record<
@@ -85,7 +88,8 @@ const settingsLoaders: Record<
8588
ru: () => import('@frontend-locales/ru/settings.json'),
8689
tr: () => import('@frontend-locales/tr/settings.json'),
8790
zh: () => import('@frontend-locales/zh/settings.json'),
88-
'zh-TW': () => import('@frontend-locales/zh-TW/settings.json')
91+
'zh-TW': () => import('@frontend-locales/zh-TW/settings.json'),
92+
'pt-BR': () => import('@frontend-locales/pt-BR/settings.json')
8993
}
9094

9195
// Track which locales have been loaded

src/i18n.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ const localeLoaders: Record<
3636
ru: () => import('./locales/ru/main.json'),
3737
tr: () => import('./locales/tr/main.json'),
3838
zh: () => import('./locales/zh/main.json'),
39-
'zh-TW': () => import('./locales/zh-TW/main.json')
39+
'zh-TW': () => import('./locales/zh-TW/main.json'),
40+
'pt-BR': () => import('./locales/pt-BR/main.json')
4041
}
4142

4243
const nodeDefsLoaders: Record<
@@ -51,7 +52,8 @@ const nodeDefsLoaders: Record<
5152
ru: () => import('./locales/ru/nodeDefs.json'),
5253
tr: () => import('./locales/tr/nodeDefs.json'),
5354
zh: () => import('./locales/zh/nodeDefs.json'),
54-
'zh-TW': () => import('./locales/zh-TW/nodeDefs.json')
55+
'zh-TW': () => import('./locales/zh-TW/nodeDefs.json'),
56+
'pt-BR': () => import('./locales/pt-BR/nodeDefs.json')
5557
}
5658

5759
const commandsLoaders: Record<
@@ -66,7 +68,8 @@ const commandsLoaders: Record<
6668
ru: () => import('./locales/ru/commands.json'),
6769
tr: () => import('./locales/tr/commands.json'),
6870
zh: () => import('./locales/zh/commands.json'),
69-
'zh-TW': () => import('./locales/zh-TW/commands.json')
71+
'zh-TW': () => import('./locales/zh-TW/commands.json'),
72+
'pt-BR': () => import('./locales/pt-BR/commands.json')
7073
}
7174

7275
const settingsLoaders: Record<
@@ -81,7 +84,8 @@ const settingsLoaders: Record<
8184
ru: () => import('./locales/ru/settings.json'),
8285
tr: () => import('./locales/tr/settings.json'),
8386
zh: () => import('./locales/zh/settings.json'),
84-
'zh-TW': () => import('./locales/zh-TW/settings.json')
87+
'zh-TW': () => import('./locales/zh-TW/settings.json'),
88+
'pt-BR': () => import('./locales/pt-BR/settings.json')
8589
}
8690

8791
// Track which locales have been loaded

src/locales/pt-BR/commands.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

src/locales/pt-BR/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

src/locales/pt-BR/nodeDefs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

src/locales/pt-BR/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

src/platform/settings/constants/coreSettings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ export const CORE_SETTINGS: SettingParams[] = [
416416
{ value: 'fr', text: 'Français' },
417417
{ value: 'es', text: 'Español' },
418418
{ value: 'ar', text: 'عربي' },
419-
{ value: 'tr', text: 'Türkçe' }
419+
{ value: 'tr', text: 'Türkçe' },
420+
{ value: 'pt-BR', text: 'Português (BR)' }
420421
],
421422
defaultValue: () => navigator.language.split('-')[0] || 'en'
422423
},

0 commit comments

Comments
 (0)