chore: add missing i18n keys in sidebar, assets, toolbox, dropdowns (#6622)

This PR 

- adds missing locale keys for 3D viewer toast strings, assets sidebar
labels, and node error keys
- cleans up the selection toolbox, media previews, node components, and
widget uploader to rely on `$t`/`st` (exposed to template scope at
compile time) instead of importing from `useI18n`.
- updates `eslint.config.ts` to teach the Intlify rule about the locale
layout

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6622-chore-add-missing-i18n-keys-in-sidebar-assets-toolbox-dropdowns-2a36d73d365081ae8694eb4f8ebb822a)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Alexander Brown <drjkl@comfy.org>
This commit is contained in:
Christian Byrne
2025-11-11 13:27:07 -08:00
committed by GitHub
parent 3c550e953a
commit 2542449d45
21 changed files with 96 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div v-if="renderError" class="node-error p-2 text-sm text-red-500">
{{ $t('Node Render Error') }}
{{ st('nodeErrors.render', 'Node Render Error') }}
</div>
<div
v-else
@@ -144,6 +144,7 @@ import { useI18n } from 'vue-i18n'
import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
import { toggleNodeOptions } from '@/composables/graph/useMoreOptionsMenu'
import { useErrorHandling } from '@/composables/useErrorHandling'
import { st } from '@/i18n'
import { LGraphEventMode, LiteGraph } from '@/lib/litegraph/src/litegraph'
import { useSettingStore } from '@/platform/settings/settingStore'
import { useTelemetry } from '@/platform/telemetry'

View File

@@ -1,6 +1,6 @@
<template>
<div v-if="renderError" class="node-error p-2 text-sm text-red-500">
{{ $t('Node Content Error') }}
{{ st('nodeErrors.content', 'Node Content Error') }}
</div>
<div v-else class="lg-node-content flex grow flex-col">
<!-- Default slot for custom content -->
@@ -26,6 +26,7 @@ import { computed, onErrorCaptured, ref } from 'vue'
import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
import { useErrorHandling } from '@/composables/useErrorHandling'
import { st } from '@/i18n'
import VideoPreview from '../VideoPreview.vue'
import ImagePreview from './ImagePreview.vue'

View File

@@ -1,6 +1,6 @@
<template>
<div v-if="renderError" class="node-error p-4 text-sm text-red-500">
{{ $t('Node Header Error') }}
{{ st('nodeErrors.header', 'Node Header Error') }}
</div>
<div
v-else

View File

@@ -1,6 +1,6 @@
<template>
<div v-if="renderError" class="node-error p-2 text-sm text-red-500">
{{ $t('Node Slots Error') }}
{{ st('nodeErrors.slots', 'Node Slots Error') }}
</div>
<div v-else :class="cn('flex justify-between', unifiedWrapperClass)">
<div
@@ -38,6 +38,7 @@ import { computed, onErrorCaptured, ref } from 'vue'
import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
import { useErrorHandling } from '@/composables/useErrorHandling'
import { st } from '@/i18n'
import type { INodeSlot } from '@/lib/litegraph/src/litegraph'
import {
linkedWidgetedInputs,

View File

@@ -1,6 +1,6 @@
<template>
<div v-if="renderError" class="node-error p-2 text-sm text-red-500">
{{ $t('Node Widgets Error') }}
{{ st('nodeErrors.widgets', 'Node Widgets Error') }}
</div>
<div
v-else
@@ -67,6 +67,7 @@ import type {
WidgetSlotMetadata
} from '@/composables/graph/useGraphNodeManager'
import { useErrorHandling } from '@/composables/useErrorHandling'
import { st } from '@/i18n'
import { useCanvasInteractions } from '@/renderer/core/canvas/useCanvasInteractions'
import { useNodeTooltips } from '@/renderer/extensions/vueNodes/composables/useNodeTooltips'
import WidgetDOM from '@/renderer/extensions/vueNodes/widgets/components/WidgetDOM.vue'

View File

@@ -23,7 +23,10 @@ describe('WidgetFileUpload File Handling', () => {
messages: {
en: {
...enMessages,
'Drop your file or': 'Drop your file or'
widgetFileUpload: {
dropPrompt: 'Drop your file or',
browseFiles: 'Browse Files'
}
}
}
})

View File

@@ -156,10 +156,12 @@
:style="{ borderColor: '#262729' }"
>
<div class="flex w-full flex-col items-center gap-2 py-4">
<span class="text-xs opacity-60"> {{ $t('Drop your file or') }} </span>
<span class="text-xs opacity-60">
{{ $t('widgetFileUpload.dropPrompt') }}
</span>
<div>
<Button
label="Browse Files"
:label="$t('widgetFileUpload.browseFiles')"
size="small"
severity="secondary"
class="text-xs"