mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-22 15:29:44 +00:00
Translate core setting name & tooltip (#1765)
* lazy eval default value * Add setting translation * Adjust hooks * Add all translations * nit * Normalized setting id * Update locales * Fallback * Locale => Language * Locale => Language * Update translations
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<FormItem
|
||||
:item="setting"
|
||||
:item="formItem"
|
||||
:id="setting.id"
|
||||
:formValue="settingValue"
|
||||
@update:formValue="updateSettingValue"
|
||||
@@ -22,11 +22,24 @@ import FormItem from '@/components/common/FormItem.vue'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
import { SettingParams } from '@/types/settingTypes'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const props = defineProps<{
|
||||
setting: SettingParams
|
||||
}>()
|
||||
|
||||
const { t } = useI18n()
|
||||
const formItem = computed(() => {
|
||||
const normalizedId = props.setting.id.replace(/\./g, '_')
|
||||
return {
|
||||
...props.setting,
|
||||
name: t(`settingsDialog.${normalizedId}.name`, props.setting.name),
|
||||
tooltip: props.setting.tooltip
|
||||
? t(`settingsDialog.${normalizedId}.tooltip`, props.setting.tooltip)
|
||||
: undefined
|
||||
}
|
||||
})
|
||||
|
||||
const settingStore = useSettingStore()
|
||||
const settingValue = computed(() => settingStore.get(props.setting.id))
|
||||
const updateSettingValue = (value: any) => {
|
||||
|
||||
Reference in New Issue
Block a user