Skip to content

Commit 3b3fbc6

Browse files
committed
chore: minor code improvements
1 parent 0185e26 commit 3b3fbc6

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

app/composables/useStructuredFilters.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
306306
})
307307

308308
// i18n key mappings for filter chip values
309-
const downloadRangeKeys = computed<Record<DownloadRange, string>>(() => ({
309+
const downloadRangeLabels = computed<Record<DownloadRange, string>>(() => ({
310310
'any': t('filters.download_range.any'),
311311
'lt100': t('filters.download_range.lt100'),
312312
'100-1k': t('filters.download_range.100_1k'),
@@ -315,13 +315,13 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
315315
'gt100k': t('filters.download_range.gt100k'),
316316
}))
317317

318-
const securityKeys = computed<Record<SecurityFilter, string>>(() => ({
318+
const securityLabels = computed<Record<SecurityFilter, string>>(() => ({
319319
all: t('filters.security_options.all'),
320320
secure: t('filters.security_options.secure'),
321321
warnings: t('filters.security_options.insecure'),
322322
}))
323323

324-
const updatedWithinKeys = computed<Record<UpdatedWithin, string>>(() => ({
324+
const updatedWithinLabels = computed<Record<UpdatedWithin, string>>(() => ({
325325
any: t('filters.updated.any'),
326326
week: t('filters.updated.week'),
327327
month: t('filters.updated.month'),
@@ -347,7 +347,7 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
347347
id: 'downloadRange',
348348
type: 'downloadRange',
349349
label: t('filters.chips.downloads'),
350-
value: downloadRangeKeys.value[filters.value.downloadRange],
350+
value: downloadRangeLabels.value[filters.value.downloadRange],
351351
})
352352
}
353353

@@ -365,7 +365,7 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
365365
id: 'security',
366366
type: 'security',
367367
label: t('filters.chips.security'),
368-
value: securityKeys.value[filters.value.security],
368+
value: securityLabels.value[filters.value.security],
369369
})
370370
}
371371

@@ -374,7 +374,7 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
374374
id: 'updatedWithin',
375375
type: 'updatedWithin',
376376
label: t('filters.chips.updated'),
377-
value: updatedWithinKeys.value[filters.value.updatedWithin],
377+
value: updatedWithinLabels.value[filters.value.updatedWithin],
378378
})
379379
}
380380

scripts/find-invalid-translations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function run(): Promise<void> {
5050

5151
printSection('Missing keys', missingKeys, hasMissingKeys ? 'error' : 'success')
5252

53-
printSection('Unused keys', unusedKeys, hasUnusedKeys ? 'warning' : 'success')
53+
printSection('Unused keys', unusedKeys, hasUnusedKeys ? 'error' : 'success')
5454

5555
printSection(
5656
'Dynamic keys (cannot be statically analyzed)',
@@ -64,7 +64,7 @@ async function run(): Promise<void> {
6464
const shouldFail = hasMissingKeys || hasDynamicKeys || hasUnusedKeys
6565

6666
if (shouldFail) {
67-
console.log(colors.red('\n❌ Build failed: missing or dynamic keys detected'))
67+
console.log(colors.red('\n❌ Build failed: missing, unused or dynamic keys detected'))
6868
console.log(colors.dim(' Fix missing keys by adding them to the locale file'))
6969
console.log(colors.dim(' Fix dynamic keys by using static translation keys\n'))
7070
console.log(

0 commit comments

Comments
 (0)