1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

feat(web): add chinese (traditional), bislama and croatian to our supported languages (#10283)

* feat(web): add chinese (traditional), bislama and croatian to our supported languages

* test: remove language tag tests as it doesn't really test the correctness of tags
This commit is contained in:
Zack Pollard 2024-06-13 16:00:55 +01:00 committed by GitHub
parent 0de15121f2
commit 5e99f651ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 13 deletions

View file

@ -248,6 +248,7 @@ export const defaultLang = { name: 'English', code: 'en', loader: () => import('
export const langs = [
{ name: 'Arabic', code: 'ar', loader: () => import('$lib/i18n/ar.json') },
{ name: 'Bislama', code: 'bi', loader: () => import('$lib/i18n/bi.json') },
{ name: 'Catalan', code: 'ca', loader: () => import('$lib/i18n/ca.json') },
{ name: 'Czech', code: 'cs', loader: () => import('$lib/i18n/cs.json') },
{ name: 'Danish', code: 'da', loader: () => import('$lib/i18n/da.json') },
@ -258,6 +259,7 @@ export const langs = [
{ name: 'French', code: 'fr', loader: () => import('$lib/i18n/fr.json') },
{ name: 'Hebrew', code: 'he', loader: () => import('$lib/i18n/he.json') },
{ name: 'Hindi', code: 'hi', loader: () => import('$lib/i18n/hi.json') },
{ name: 'Croatian', code: 'hr', loader: () => import('$lib/i18n/hr.json') },
{ name: 'Hungarian', code: 'hu', loader: () => import('$lib/i18n/hu.json') },
{ name: 'Italian', code: 'it', loader: () => import('$lib/i18n/it.json') },
{ name: 'Japanese', code: 'ja', loader: () => import('$lib/i18n/ja.json') },
@ -278,6 +280,7 @@ export const langs = [
{ name: 'Thai', code: 'th', loader: () => import('$lib/i18n/th.json') },
{ name: 'Ukrainian', code: 'uk', loader: () => import('$lib/i18n/uk.json') },
{ name: 'Vietnamese', code: 'vi', loader: () => import('$lib/i18n/vi.json') },
{ name: 'Chinese (Traditional)', code: 'zh-Hant', loader: () => import('$lib/i18n/zh_Hant.json') },
{ name: 'Chinese (Simplified)', code: 'zh-Hans', loader: () => import('$lib/i18n/zh_SIMPLIFIED.json') },
{ name: 'Development (keys only)', code: 'dev', loader: () => Promise.resolve({}) },
];

View file

@ -1,4 +1,3 @@
import { langs } from '$lib/constants';
import messages from '$lib/i18n/en.json';
import { exec as execCallback } from 'node:child_process';
import { promisify } from 'node:util';
@ -31,16 +30,4 @@ describe('i18n', () => {
// Only translations directly using the store seem to get extracted
expect({ ...extractedMessages, ...existingMessages }).toEqual(existingMessages);
});
describe('language tags', () => {
for (const lang of langs) {
if (lang.code === 'dev') {
continue;
}
test(`language tag ${lang.code} is valid`, () => {
expect(Intl.NumberFormat.supportedLocalesOf(lang.code)).toHaveLength(1);
});
}
});
});