Skip to content

Commit 8b5cfe7

Browse files
authored
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?
1 parent 1351690 commit 8b5cfe7

File tree

14 files changed

+95
-45
lines changed

14 files changed

+95
-45
lines changed

eslint.config.ts

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,19 @@ export default defineConfig([
191191
'@intlify/vue-i18n/no-raw-text': [
192192
'error',
193193
{
194+
attributes: {
195+
'/.+/': [
196+
'aria-label',
197+
'aria-placeholder',
198+
'aria-roledescription',
199+
'aria-valuetext',
200+
'label',
201+
'placeholder',
202+
'title',
203+
'v-tooltip'
204+
],
205+
img: ['alt']
206+
},
194207
// Ignore strings that are:
195208
// 1. Less than 2 characters
196209
// 2. Only symbols/numbers/whitespace (no letters)
@@ -200,24 +213,27 @@ export default defineConfig([
200213
ignoreNodes: ['md-icon', 'v-icon', 'pre', 'code', 'script', 'style'],
201214
// Brand names and technical terms that shouldn't be translated
202215
ignoreText: [
203-
'ComfyUI',
204-
'GitHub',
205-
'OpenAI',
206216
'API',
207-
'URL',
208-
'JSON',
209-
'YAML',
210-
'GPU',
217+
'App Data:',
218+
'App Path:',
219+
'ComfyUI',
211220
'CPU',
212-
'RAM',
221+
'fps',
213222
'GB',
214-
'MB',
223+
'GitHub',
224+
'GPU',
225+
'JSON',
215226
'KB',
227+
'LoRA',
228+
'MB',
216229
'ms',
217-
'fps',
230+
'OpenAI',
231+
'png',
218232
'px',
219-
'App Data:',
220-
'App Path:'
233+
'RAM',
234+
'URL',
235+
'YAML',
236+
'1.2 MB'
221237
]
222238
}
223239
]

src/components/maskeditor/BrushSettingsPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
/>
8181

8282
<SliderControl
83-
label="Stepsize"
83+
:label="$t('maskEditor.stepSize')"
8484
:min="1"
8585
:max="100"
8686
:step="1"

src/components/queue/CompletionSummaryBanner.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
class="inline-block h-6 w-6 overflow-hidden rounded-[6px] border-0 bg-secondary-background"
2626
:style="{ marginLeft: idx === 0 ? '0' : '-12px' }"
2727
>
28-
<img :src="url" alt="preview" class="h-full w-full object-cover" />
28+
<img
29+
:src="url"
30+
:alt="$t('sideToolbar.queueProgressOverlay.preview')"
31+
class="h-full w-full object-cover"
32+
/>
2933
</span>
3034
</span>
3135

src/components/widget/SampleModelSelector.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<template #default="{ close }">
3131
<IconTextButton
3232
type="secondary"
33-
label="Settings"
33+
:label="$t('g.settings')"
3434
@click="
3535
() => {
3636
close()
@@ -43,7 +43,7 @@
4343
</IconTextButton>
4444
<IconTextButton
4545
type="primary"
46-
label="Profile"
46+
:label="$t('g.profile')"
4747
@click="
4848
() => {
4949
close()
@@ -65,20 +65,20 @@
6565
v-model="selectedFrameworks"
6666
v-model:search-query="searchText"
6767
class="w-[250px]"
68-
label="Select Frameworks"
68+
:label="$t('assetBrowser.selectFrameworks')"
6969
:options="frameworkOptions"
7070
:show-search-box="true"
7171
:show-selected-count="true"
7272
:show-clear-button="true"
7373
/>
7474
<MultiSelect
7575
v-model="selectedProjects"
76-
label="Select Projects"
76+
:label="$t('assetBrowser.selectProjects')"
7777
:options="projectOptions"
7878
/>
7979
<SingleSelect
8080
v-model="selectedSort"
81-
label="Sorting Type"
81+
:label="$t('assetBrowser.sortingType')"
8282
:options="sortOptions"
8383
class="w-[135px]"
8484
>

src/locales/en/main.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"dropYourFileOr": "Drop your file or",
106106
"back": "Back",
107107
"next": "Next",
108+
"submit": "Submit",
108109
"install": "Install",
109110
"installing": "Installing",
110111
"overwrite": "Overwrite",
@@ -234,6 +235,7 @@
234235
"frameNodes": "Frame Nodes",
235236
"listening": "Listening...",
236237
"ready": "Ready",
238+
"playPause": "Play/Pause",
237239
"playRecording": "Play Recording",
238240
"playing": "Playing",
239241
"stopPlayback": "Stop Playback",
@@ -242,7 +244,9 @@
242244
"halfSpeed": "0.5x",
243245
"1x": "1x",
244246
"2x": "2x",
245-
"beta": "BETA"
247+
"beta": "BETA",
248+
"profile": "Profile",
249+
"noItems": "No items"
246250
},
247251
"manager": {
248252
"title": "Custom Nodes Manager",
@@ -689,6 +693,7 @@
689693
"currentNode": "Current node:",
690694
"viewAllJobs": "View all jobs",
691695
"running": "running",
696+
"preview": "Preview",
692697
"interruptAll": "Interrupt all running jobs",
693698
"moreOptions": "More options",
694699
"showAssets": "Show assets",
@@ -930,6 +935,7 @@
930935
"thickness": "Thickness",
931936
"opacity": "Opacity",
932937
"hardness": "Hardness",
938+
"stepSize": "Step Size",
933939
"smoothingPrecision": "Smoothing Precision",
934940
"resetToDefault": "Reset to Default",
935941
"paintBucketSettings": "Paint Bucket Settings",
@@ -1835,6 +1841,7 @@
18351841
"title": "Subscription",
18361842
"titleUnsubscribed": "Subscribe to Comfy Cloud",
18371843
"comfyCloud": "Comfy Cloud",
1844+
"comfyCloudLogo": "Comfy Cloud Logo",
18381845
"beta": "BETA",
18391846
"perMonth": "USD / month",
18401847
"renewsDate": "Renews {date}",
@@ -2070,6 +2077,7 @@
20702077
"cloudSurvey_steps_making": "What do you plan on making?",
20712078
"assetBrowser": {
20722079
"assets": "Assets",
2080+
"assetCollection": "Asset collection",
20732081
"checkpoints": "Checkpoints",
20742082
"browseAssets": "Browse Assets",
20752083
"noAssetsFound": "No assets found",
@@ -2120,6 +2128,9 @@
21202128
"sortZA": "Z-A",
21212129
"sortRecent": "Recent",
21222130
"sortPopular": "Popular",
2131+
"selectFrameworks": "Select Frameworks",
2132+
"selectProjects": "Select Projects",
2133+
"sortingType": "Sorting Type",
21232134
"errorFileTooLarge": "File exceeds the maximum allowed size limit",
21242135
"errorFormatNotAllowed": "Only SafeTensor format is allowed",
21252136
"errorUnsafePickleScan": "CivitAI detected potentially unsafe code in this file",

src/platform/assets/components/AssetGrid.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
data-component-id="AssetGrid"
44
:style="gridStyle"
55
role="grid"
6-
aria-label="Asset collection"
6+
:aria-label="$t('assetBrowser.assetCollection')"
77
:aria-rowcount="-1"
88
:aria-colcount="-1"
99
:aria-setsize="assets.length"

src/platform/assets/components/MediaAssetMoreMenu.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<IconTextButton
77
v-if="asset?.kind !== '3D'"
88
type="transparent"
9-
label="Inspect asset"
9+
:label="$t('queue.jobMenu.inspectAsset')"
1010
@click="handleInspect"
1111
>
1212
<template #icon>
@@ -17,15 +17,19 @@
1717
<IconTextButton
1818
v-if="showAddToWorkflow"
1919
type="transparent"
20-
label="Add to current workflow"
20+
:label="$t('queue.jobMenu.addToCurrentWorkflow')"
2121
@click="handleAddToWorkflow"
2222
>
2323
<template #icon>
2424
<i class="icon-[comfy--node] size-4" />
2525
</template>
2626
</IconTextButton>
2727

28-
<IconTextButton type="transparent" label="Download" @click="handleDownload">
28+
<IconTextButton
29+
type="transparent"
30+
:label="$t('queue.jobMenu.download')"
31+
@click="handleDownload"
32+
>
2933
<template #icon>
3034
<i class="icon-[lucide--download] size-4" />
3135
</template>
@@ -36,7 +40,7 @@
3640
<IconTextButton
3741
v-if="showWorkflowActions"
3842
type="transparent"
39-
label="Open as workflow in new tab"
43+
:label="$t('queue.jobMenu.openAsWorkflowNewTab')"
4044
@click="handleOpenWorkflow"
4145
>
4246
<template #icon>
@@ -47,7 +51,7 @@
4751
<IconTextButton
4852
v-if="showWorkflowActions"
4953
type="transparent"
50-
label="Export workflow"
54+
:label="$t('queue.jobMenu.exportWorkflow')"
5155
@click="handleExportWorkflow"
5256
>
5357
<template #icon>
@@ -60,7 +64,7 @@
6064
<IconTextButton
6165
v-if="showCopyJobId"
6266
type="transparent"
63-
label="Copy job ID"
67+
:label="$t('queue.jobMenu.copyJobId')"
6468
@click="handleCopyJobId"
6569
>
6670
<template #icon>
@@ -73,7 +77,7 @@
7377
<IconTextButton
7478
v-if="shouldShowDeleteButton"
7579
type="transparent"
76-
label="Delete"
80+
:label="$t('queue.jobMenu.delete')"
7781
@click="handleDelete"
7882
>
7983
<template #icon>

src/platform/cloud/onboarding/CloudSurveyView.vue

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<div class="flex justify-between pt-4">
4545
<span />
4646
<Button
47-
label="Next"
47+
:label="$t('g.next')"
4848
:disabled="!validStep1"
4949
class="h-10 w-full border-none text-white"
5050
@click="goTo(2, activateCallback)"
@@ -84,20 +84,22 @@
8484
<InputText
8585
v-model="surveyData.useCaseOther"
8686
class="w-full"
87-
placeholder="Please specify"
87+
:placeholder="
88+
$t('cloudOnboarding.survey.options.industry.otherPlaceholder')
89+
"
8890
/>
8991
</div>
9092
</div>
9193

9294
<div class="flex gap-6 pt-4">
9395
<Button
94-
label="Back"
96+
:label="$t('g.back')"
9597
severity="secondary"
9698
class="flex-1 text-white"
9799
@click="goTo(1, activateCallback)"
98100
/>
99101
<Button
100-
label="Next"
102+
:label="$t('g.next')"
101103
:disabled="!validStep2"
102104
class="h-10 flex-1 text-white"
103105
@click="goTo(3, activateCallback)"
@@ -137,20 +139,22 @@
137139
<InputText
138140
v-model="surveyData.industryOther"
139141
class="w-full"
140-
placeholder="Please specify"
142+
:placeholder="
143+
$t('cloudOnboarding.survey.options.industry.otherPlaceholder')
144+
"
141145
/>
142146
</div>
143147
</div>
144148

145149
<div class="flex gap-6 pt-4">
146150
<Button
147-
label="Back"
151+
:label="$t('g.back')"
148152
severity="secondary"
149153
class="flex-1 text-white"
150154
@click="goTo(2, activateCallback)"
151155
/>
152156
<Button
153-
label="Next"
157+
:label="$t('g.next')"
154158
:disabled="!validStep3"
155159
class="h-10 flex-1 border-none text-white"
156160
@click="goTo(4, activateCallback)"
@@ -189,13 +193,13 @@
189193

190194
<div class="flex gap-6 pt-4">
191195
<Button
192-
label="Back"
196+
:label="$t('g.back')"
193197
severity="secondary"
194198
class="flex-1 text-white"
195199
@click="goTo(3, activateCallback)"
196200
/>
197201
<Button
198-
label="Submit"
202+
:label="$t('g.submit')"
199203
:disabled="!validStep4 || isSubmitting"
200204
:loading="isSubmitting"
201205
class="h-10 flex-1 border-none text-white"

src/platform/cloud/onboarding/components/CloudLogo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="mx-auto flex h-[7%] max-h-[70px] w-5/6 items-end">
33
<img
44
src="/assets/images/comfy-cloud-logo.svg"
5-
alt="Comfy Cloud Logo"
5+
:alt="$t('subscription.comfyCloudLogo')"
66
class="h-3/4 max-h-10 w-auto"
77
/>
88
</div>

src/renderer/extensions/vueNodes/widgets/components/audio/AudioPreviewPlayer.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div
2424
role="button"
2525
:tabindex="0"
26-
aria-label="Play/Pause"
26+
:aria-label="$t('g.playPause')"
2727
class="flex size-6 cursor-pointer items-center justify-center rounded hover:bg-interface-menu-component-surface-hovered"
2828
@click="togglePlayPause"
2929
>
@@ -64,7 +64,7 @@
6464
<div
6565
role="button"
6666
:tabindex="0"
67-
aria-label="Volume"
67+
:aria-label="$t('g.volume')"
6868
class="flex size-6 cursor-pointer items-center justify-center rounded hover:bg-interface-menu-component-surface-hovered"
6969
@click="toggleMute"
7070
>
@@ -85,7 +85,7 @@
8585
ref="optionsButtonRef"
8686
role="button"
8787
:tabindex="0"
88-
aria-label="More Options"
88+
:aria-label="$t('g.moreOptions')"
8989
class="flex size-6 cursor-pointer items-center justify-center rounded hover:bg-interface-menu-component-surface-hovered"
9090
@click="toggleOptionsMenu"
9191
>

0 commit comments

Comments
 (0)