mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 10:14:06 +00:00
refactor: use vue-i18n for toggle option labels
- Add 'yes', 'on', 'off' keys to locales/en/main.json - Replace hardcoded strings in WidgetSelectToggle with t() function
This commit is contained in:
@@ -95,6 +95,9 @@
|
||||
"save": "Save",
|
||||
"saving": "Saving",
|
||||
"no": "No",
|
||||
"yes": "Yes",
|
||||
"on": "On",
|
||||
"off": "Off",
|
||||
"cancel": "Cancel",
|
||||
"close": "Close",
|
||||
"pressKeysForNewBinding": "Press keys for new binding",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { t } from '@/i18n'
|
||||
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
||||
import { cn } from '@/utils/tailwindUtil'
|
||||
import {
|
||||
@@ -48,15 +49,15 @@ const options = computed<ToggleOption[]>(() => {
|
||||
// Default options for boolean widgets
|
||||
if (typeof modelValue.value === 'boolean') {
|
||||
return [
|
||||
{ label: 'On', value: true },
|
||||
{ label: 'Off', value: false }
|
||||
{ label: t('g.on', 'On'), value: true },
|
||||
{ label: t('g.off', 'Off'), value: false }
|
||||
]
|
||||
}
|
||||
|
||||
// Fallback default options
|
||||
return [
|
||||
{ label: 'Yes', value: true },
|
||||
{ label: 'No', value: false }
|
||||
{ label: t('g.yes', 'Yes'), value: true },
|
||||
{ label: t('g.no', 'No'), value: false }
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user