From 8b5cfe7e5562a1917ffe311933220617223e4572 Mon Sep 17 00:00:00 2001 From: Alexander Brown Date: Mon, 24 Nov 2025 21:55:47 -0800 Subject: [PATCH] Lint: Adding more checks for non internationalized strings (#5625) ## Summary Catch more user visible (or audible) text that isn't internationalizable. ## Changes - **What**: Linter now checks other attributes for raw text. ## Review Focus What other properties have leaked English text to non-English locales that aren't in here? --- eslint.config.ts | 48 ++++++++++++------- .../maskeditor/BrushSettingsPanel.vue | 2 +- .../queue/CompletionSummaryBanner.vue | 6 ++- src/components/widget/SampleModelSelector.vue | 10 ++-- src/locales/en/main.json | 13 ++++- src/platform/assets/components/AssetGrid.vue | 2 +- .../assets/components/MediaAssetMoreMenu.vue | 18 ++++--- .../cloud/onboarding/CloudSurveyView.vue | 22 +++++---- .../cloud/onboarding/components/CloudLogo.vue | 2 +- .../components/audio/AudioPreviewPlayer.vue | 6 +-- .../form/dropdown/FormDropdownMenu.vue | 2 +- .../form/dropdown/FormDropdownMenuActions.vue | 2 +- .../components/ManagerProgressFooter.vue | 10 +++- .../footer/ManagerProgressFooter.test.ts | 5 ++ 14 files changed, 99 insertions(+), 49 deletions(-) diff --git a/eslint.config.ts b/eslint.config.ts index 46a3d94d2..a720bb00a 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -191,6 +191,19 @@ export default defineConfig([ '@intlify/vue-i18n/no-raw-text': [ 'error', { + attributes: { + '/.+/': [ + 'aria-label', + 'aria-placeholder', + 'aria-roledescription', + 'aria-valuetext', + 'label', + 'placeholder', + 'title', + 'v-tooltip' + ], + img: ['alt'] + }, // Ignore strings that are: // 1. Less than 2 characters // 2. Only symbols/numbers/whitespace (no letters) @@ -200,24 +213,27 @@ export default defineConfig([ ignoreNodes: ['md-icon', 'v-icon', 'pre', 'code', 'script', 'style'], // Brand names and technical terms that shouldn't be translated ignoreText: [ - 'ComfyUI', - 'GitHub', - 'OpenAI', 'API', - 'URL', - 'JSON', - 'YAML', - 'GPU', - 'CPU', - 'RAM', - 'GB', - 'MB', - 'KB', - 'ms', - 'fps', - 'px', 'App Data:', - 'App Path:' + 'App Path:', + 'ComfyUI', + 'CPU', + 'fps', + 'GB', + 'GitHub', + 'GPU', + 'JSON', + 'KB', + 'LoRA', + 'MB', + 'ms', + 'OpenAI', + 'png', + 'px', + 'RAM', + 'URL', + 'YAML', + '1.2 MB' ] } ] diff --git a/src/components/maskeditor/BrushSettingsPanel.vue b/src/components/maskeditor/BrushSettingsPanel.vue index 7f81359fc..a43707ac1 100644 --- a/src/components/maskeditor/BrushSettingsPanel.vue +++ b/src/components/maskeditor/BrushSettingsPanel.vue @@ -80,7 +80,7 @@ /> - preview + diff --git a/src/components/widget/SampleModelSelector.vue b/src/components/widget/SampleModelSelector.vue index 3f06ce277..7f0147a3b 100644 --- a/src/components/widget/SampleModelSelector.vue +++ b/src/components/widget/SampleModelSelector.vue @@ -30,7 +30,7 @@