From 0c3ea132c83fac46be3e68c4beb31083f92febf9 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Sun, 4 Apr 2021 04:01:32 +0800 Subject: [PATCH] Localize sidebar --- src/components/Sidebar/Sidebar.svelte | 24 +++++++++++++++--------- src/locales/en.json | 11 +++++++++++ src/locales/id.json | 11 +++++++++++ src/routes/_layout.svelte | 2 +- 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/components/Sidebar/Sidebar.svelte b/src/components/Sidebar/Sidebar.svelte index 6d5f9522..727d4fd9 100644 --- a/src/components/Sidebar/Sidebar.svelte +++ b/src/components/Sidebar/Sidebar.svelte @@ -2,7 +2,7 @@ import { fly } from 'svelte/transition'; import { getContext } from 'svelte'; import { mdiCloseCircle } from '@mdi/js'; - import { locale } from 'svelte-i18n'; + import { locale, t } from 'svelte-i18n'; import Icon from '../Icon.svelte'; @@ -61,26 +61,32 @@ {/if} - + @@ -88,21 +94,21 @@ on:clicked={close} active={segment === 'todo'} image="/images/todos.png" - label="Todo List" + label={$t('sidebar.todoList')} href="/todo" />
@@ -127,7 +133,7 @@
diff --git a/src/locales/en.json b/src/locales/en.json index 940d6be7..6a700770 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,4 +1,15 @@ { + "sidebar": { + "home": "Home", + "character": "Character", + "wishCounter": "Wish Counter", + "calculator": "Calculator", + "items": "Items", + "todoList": "Todo List", + "timeline": "Timeline", + "settings": "Settings", + "donate": "Donate" + }, "home": { "welcome": "Welcome to Paimon.moe! 👋", "message": "Your best Genshin Impact companion! Help you plan what to farm with ascension calculator, also track your progress with todo and wish counter.", diff --git a/src/locales/id.json b/src/locales/id.json index 5ecda79d..117b5b09 100644 --- a/src/locales/id.json +++ b/src/locales/id.json @@ -1,4 +1,15 @@ { + "sidebar": { + "home": "Home", + "character": "Karakter", + "wishCounter": "Wish Counter", + "calculator": "Kalkulator", + "items": "Item", + "todoList": "Todo List", + "timeline": "Timeline", + "settings": "Pengaturan", + "donate": "Donasi" + }, "home": { "welcome": "Selamat Datang di Paimon.moe! 👋", "message": "Your best Genshin Impact companion! Membantu kamu merencanakan apa yang harus di farm dengan kalkulator ascension, juga catat progress mu dengan todo dan wish counter.", diff --git a/src/routes/_layout.svelte b/src/routes/_layout.svelte index 08899770..09c35d3e 100644 --- a/src/routes/_layout.svelte +++ b/src/routes/_layout.svelte @@ -69,7 +69,7 @@