From f37b5e15766e12fa606f3d5b9fe7ce1e725bcf97 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Wed, 2 Jun 2021 19:43:50 +0700 Subject: [PATCH] Add pt language --- src/components/Sidebar/Sidebar.svelte | 11 ++-- src/i18n.js | 2 + static/images/locales/pt.svg | 88 +++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 static/images/locales/pt.svg diff --git a/src/components/Sidebar/Sidebar.svelte b/src/components/Sidebar/Sidebar.svelte index d7b92788..a25e5793 100644 --- a/src/components/Sidebar/Sidebar.svelte +++ b/src/components/Sidebar/Sidebar.svelte @@ -21,12 +21,13 @@ export let mobile = false; const languages = [ - { id: 'en', label: 'English' }, - { id: 'id', label: 'Indonesia' }, - { id: 'ru', label: 'Русский' }, - { id: 'ko', label: '한국어' }, - { id: 'fr', label: 'Français' }, { id: 'zh', label: '中文(简体)' }, + { id: 'en', label: 'English' }, + { id: 'fr', label: 'Français' }, + { id: 'ko', label: '한국어' }, + { id: 'id', label: 'Indonesia' }, + { id: 'pt', label: 'Português' }, + { id: 'ru', label: 'Русский' }, ]; $: currentLocale = languages.find((e) => e.id === $locale.substring(0, 2)) || { id: 'en', label: 'English' }; $: locales = languages.filter((e) => e.id !== currentLocale.id); diff --git a/src/i18n.js b/src/i18n.js index e0d86807..284c1c0d 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -6,6 +6,7 @@ import ru from './locales/ru.json'; import ko from './locales/ko.json'; import fr from './locales/fr.json'; import zh from './locales/zh.json'; +import pt from './locales/pt.json'; const INIT_OPTIONS = { fallbackLocale: 'en', @@ -30,6 +31,7 @@ addMessages('ru', ru); addMessages('ko', ko); addMessages('fr', fr); addMessages('zh', zh); +addMessages('pt', pt); export function startClient() { const savedLocale = localStorage.getItem('locale'); diff --git a/static/images/locales/pt.svg b/static/images/locales/pt.svg new file mode 100644 index 00000000..a33164a4 --- /dev/null +++ b/static/images/locales/pt.svg @@ -0,0 +1,88 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +