mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
[i18n] Translate setting options (#1858)
* Collect options * Translate setting options * Update locales [skip ci] * Normalize key * Revert change of logic --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -52,7 +52,8 @@ test('collect-i18n', async ({ comfyPage }) => {
|
||||
id: setting.id,
|
||||
name: setting.name,
|
||||
tooltip: setting.tooltip,
|
||||
category: setting.category
|
||||
category: setting.category,
|
||||
options: setting.options
|
||||
}))
|
||||
})
|
||||
|
||||
@@ -61,7 +62,19 @@ test('collect-i18n', async ({ comfyPage }) => {
|
||||
normalizeI18nKey(setting.id),
|
||||
{
|
||||
name: setting.name,
|
||||
tooltip: setting.tooltip
|
||||
tooltip: setting.tooltip,
|
||||
// Don't translate the locale options as each option is in its own language.
|
||||
// e.g. "English", "中文", "Русский", "日本語", "한국어"
|
||||
options:
|
||||
setting.options && setting.id !== 'Comfy.Locale'
|
||||
? Object.fromEntries(
|
||||
setting.options.map((option) => {
|
||||
const optionLabel =
|
||||
typeof option === 'string' ? option : option.text
|
||||
return [normalizeI18nKey(optionLabel), optionLabel]
|
||||
})
|
||||
)
|
||||
: undefined
|
||||
}
|
||||
])
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user