diff --git a/src/components/Sidebar/Sidebar.svelte b/src/components/Sidebar/Sidebar.svelte index 26a40332..d7b92788 100644 --- a/src/components/Sidebar/Sidebar.svelte +++ b/src/components/Sidebar/Sidebar.svelte @@ -26,6 +26,7 @@ { id: 'ru', label: 'Русский' }, { id: 'ko', label: '한국어' }, { id: 'fr', label: 'Français' }, + { id: 'zh', label: '中文(简体)' }, ]; $: currentLocale = languages.find((e) => e.id === $locale.substring(0, 2)) || { id: 'en', label: 'English' }; $: locales = languages.filter((e) => e.id !== currentLocale.id); @@ -48,6 +49,7 @@ function changeLocale(lang) { locale.set(lang); } +
diff --git a/src/i18n.js b/src/i18n.js index 51901310..e0d86807 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -5,6 +5,7 @@ import id from './locales/id.json'; import ru from './locales/ru.json'; import ko from './locales/ko.json'; import fr from './locales/fr.json'; +import zh from './locales/zh.json'; const INIT_OPTIONS = { fallbackLocale: 'en', @@ -28,6 +29,7 @@ addMessages('id', id); addMessages('ru', ru); addMessages('ko', ko); addMessages('fr', fr); +addMessages('zh', zh); export function startClient() { const savedLocale = localStorage.getItem('locale'); diff --git a/src/locales/ch.json b/src/locales/zh.json similarity index 100% rename from src/locales/ch.json rename to src/locales/zh.json diff --git a/static/images/locales/zh.svg b/static/images/locales/zh.svg new file mode 100644 index 00000000..9f491e8c --- /dev/null +++ b/static/images/locales/zh.svg @@ -0,0 +1,134 @@ + + + + + + image/svg+xml + + + + + + Flag of the People's Republic of China + + + + + + + + + + + + + + + + + +