🌐 Integrated Chinese language
This commit is contained in:
@@ -15,6 +15,7 @@ import ca from './locales/ca.json';
|
||||
import it from './locales/it.json';
|
||||
import es from './locales/es.json';
|
||||
import nb_no from './locales/nb_NO.json';
|
||||
import zh_Hant from './locales/zh_Hant.json';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
|
||||
import type { i18n, Resource } from 'i18next';
|
||||
@@ -68,6 +69,7 @@ export class I18nService {
|
||||
this.i18n.addResourceBundle('ca', 'translation', ca);
|
||||
this.i18n.addResourceBundle('es', 'translation', es);
|
||||
this.i18n.addResourceBundle('nb_NO', 'translation', nb_no);
|
||||
this.i18n.addResourceBundle('zh_Hant', 'translation', zh_Hant);
|
||||
}
|
||||
|
||||
changeLanguage(language: string): void {
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { browser } from '$app/environment';
|
||||
import zh_Hant from '$lib/i18n/locales/zh_Hant.json';
|
||||
|
||||
export let languages: Array<{
|
||||
flag: string;
|
||||
@@ -97,6 +98,11 @@
|
||||
code: 'nb_NO',
|
||||
name: 'Norsk',
|
||||
flag: '🇳🇴'
|
||||
},
|
||||
{
|
||||
code: 'zh_Hant',
|
||||
name: 'Chinese (traditional)',
|
||||
flag: '🇨🇳'
|
||||
}
|
||||
];
|
||||
const get_selected_language = (): string => {
|
||||
|
||||
Reference in New Issue
Block a user