Add Scandinavian i18n (da/sv/nb) via DeepL pipeline.
Integrate new locale bundles, language cycling in the UI, SEO hreflang tags, and localized beta flyer HTML variants with scripts for batch translation and key validation. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { getNextLanguage, normalizeAppLanguage, SUPPORTED_LANGUAGES } from './i18nLanguages.js'
|
||||
|
||||
describe('i18nLanguages', () => {
|
||||
it('normalizes regional tags to supported base codes', () => {
|
||||
expect(normalizeAppLanguage('de-DE')).toBe('de')
|
||||
expect(normalizeAppLanguage('nb-NO')).toBe('nb')
|
||||
expect(normalizeAppLanguage('xx')).toBe('en')
|
||||
})
|
||||
|
||||
it('cycles through all supported languages', () => {
|
||||
let current: string = 'de'
|
||||
const seen = new Set<string>()
|
||||
for (let i = 0; i < SUPPORTED_LANGUAGES.length; i++) {
|
||||
seen.add(current)
|
||||
current = getNextLanguage(current)
|
||||
}
|
||||
expect(seen.size).toBe(SUPPORTED_LANGUAGES.length)
|
||||
expect(current).toBe('de')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user