Skip to content

Commit a186eb5

Browse files
committed
fix: translation status page - types, import fixes, a11y test added
1 parent 40097b0 commit a186eb5

File tree

7 files changed

+26
-18
lines changed

7 files changed

+26
-18
lines changed

app/pages/settings.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,17 @@ const setLocale: typeof setNuxti18nLocale = newLocale => {
269269
</template>
270270

271271
<!-- Simple help link for source locale -->
272+
<template v-else>
273+
<a
274+
href="https://github.com/npmx-dev/npmx.dev/tree/main/i18n/locales"
275+
target="_blank"
276+
rel="noopener noreferrer"
277+
class="inline-flex items-center gap-2 text-sm text-fg-muted hover:text-fg transition-colors duration-200 focus-visible:outline-accent/70 rounded"
278+
>
279+
<span class="i-simple-icons:github w-4 h-4" aria-hidden="true" />
280+
{{ $t('settings.help_translate') }}
281+
</a>
282+
</template>
272283
<div>
273284
<LinkBase
274285
:to="{ name: 'translation-status' }"

app/types/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import '#app'
22
import '#vue-router'
33
export * from './icon'
44
export * from './navigation'
5-
export * from './components'
65

76
declare module '#app' {
87
interface PageMeta {

i18n/locales/en.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,17 +1356,14 @@
13561356
"guide": "localization (i18n) guide",
13571357
"by_locale": "Translation progress by locale",
13581358
"by_file": "Translation progress by file",
1359-
"locale_summary": "{name} ({id})",
13601359
"complete_text": "This translation is complete, amazing job!",
1361-
"done_text": "done",
13621360
"missing_text": "missing",
13631361
"missing_keys": "There is no missing translations | Missing translation | Missing translations",
13641362
"progress_label": "Progress status for {locale}",
13651363
"table": {
13661364
"file": "File",
13671365
"status": "Status",
13681366
"error": "Error while loading file list.",
1369-
"loading": "{spinner} Loading translation files...",
13701367
"empty": "No files found",
13711368
"file_link": "Edit {file} ({lang}) on GitHub"
13721369
}

i18n/schema.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4072,15 +4072,9 @@
40724072
"by_file": {
40734073
"type": "string"
40744074
},
4075-
"locale_summary": {
4076-
"type": "string"
4077-
},
40784075
"complete_text": {
40794076
"type": "string"
40804077
},
4081-
"done_text": {
4082-
"type": "string"
4083-
},
40844078
"missing_text": {
40854079
"type": "string"
40864080
},
@@ -4102,9 +4096,6 @@
41024096
"error": {
41034097
"type": "string"
41044098
},
4105-
"loading": {
4106-
"type": "string"
4107-
},
41084099
"empty": {
41094100
"type": "string"
41104101
},

shared/types/i18n-status.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import type { Directions } from '@nuxtjs/i18n'
2-
import type { Locale } from 'vue-i18n'
3-
4-
//type LocaleKey = (typeof availableLocales)[number]
1+
import type { Directions, LocaleObject } from '@nuxtjs/i18n'
2+
type Locale = LocaleObject['code']
53

64
/**
75
* Translation status data generated by Lunaria build
@@ -11,7 +9,7 @@ export interface I18nStatus {
119
generatedAt: string
1210
/** The source locale (English) */
1311
sourceLocale: {
14-
lang: string
12+
lang: Locale
1513
label: string
1614
totalKeys: number
1715
}

test/nuxt/a11y.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ import {
191191
PackageVersions,
192192
PackageVulnerabilityTree,
193193
PaginationControls,
194+
ProgressBar,
194195
ProvenanceBadge,
195196
Readme,
196197
ReadmeTocDropdown,
@@ -3712,6 +3713,16 @@ describe('component accessibility audits', () => {
37123713
expect(results.violations).toEqual([])
37133714
})
37143715
})
3716+
3717+
describe('ProgressBar', () => {
3718+
it('should have no accessibility violations', async () => {
3719+
const component = await mountSuspended(ProgressBar, {
3720+
props: { val: 99, label: 'Progress status for en' },
3721+
})
3722+
const results = await runAxe(component)
3723+
expect(results.violations).toEqual([])
3724+
})
3725+
})
37153726
})
37163727

37173728
function applyTheme(colorMode: string, bgTheme: string | null) {

test/unit/a11y-component-coverage.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const SKIPPED_COMPONENTS: Record<string, string> = {
4747
'SkeletonBlock.vue': 'Already covered indirectly via other component tests',
4848
'SkeletonInline.vue': 'Already covered indirectly via other component tests',
4949
'Button/Group.vue': "Wrapper component, tests wouldn't make much sense here",
50+
'Translation/StatusByFile.unused.vue': 'Unused component, might be needed in the future',
5051
}
5152

5253
/**

0 commit comments

Comments
 (0)