From ae8ad36439a1b96d8fcc736027acf5e638c493bf Mon Sep 17 00:00:00 2001 From: Sunxyw Date: Thu, 16 Nov 2023 02:21:20 +0800 Subject: [PATCH] feat: add locale preferences to preferences sheet --- i18n/en-US/locale.json | 4 ++ i18n/en-US/locale_switch.json | 3 - i18n/en-US/theme_switch.json | 6 -- src/lib/shared/i18n/LocaleSwitch.svelte | 33 ---------- src/lib/shared/i18n/index.ts | 5 +- src/lib/shared/layout/header/Header.svelte | 18 +++--- .../layout/header/MobileNavigation.svelte | 16 +++-- .../layout/header/PreferencesSheet.svelte | 25 -------- .../LocalePreferencesSection.svelte | 63 +++++++++++++++++++ .../preferences/PreferencesSheet.svelte | 36 +++++++++++ .../ThemePreferencesSection.svelte} | 0 11 files changed, 125 insertions(+), 84 deletions(-) create mode 100644 i18n/en-US/locale.json delete mode 100644 i18n/en-US/locale_switch.json delete mode 100644 i18n/en-US/theme_switch.json delete mode 100644 src/lib/shared/i18n/LocaleSwitch.svelte delete mode 100644 src/lib/shared/layout/header/PreferencesSheet.svelte create mode 100644 src/lib/shared/layout/preferences/LocalePreferencesSection.svelte create mode 100644 src/lib/shared/layout/preferences/PreferencesSheet.svelte rename src/lib/shared/{theme/ThemeSwitch.svelte => layout/preferences/ThemePreferencesSection.svelte} (100%) diff --git a/i18n/en-US/locale.json b/i18n/en-US/locale.json new file mode 100644 index 0000000..db3878b --- /dev/null +++ b/i18n/en-US/locale.json @@ -0,0 +1,4 @@ +{ + "preferences": "Locale Preferences", + "language": "Language" +} diff --git a/i18n/en-US/locale_switch.json b/i18n/en-US/locale_switch.json deleted file mode 100644 index 35ea39a..0000000 --- a/i18n/en-US/locale_switch.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "label": "Change Language" -} diff --git a/i18n/en-US/theme_switch.json b/i18n/en-US/theme_switch.json deleted file mode 100644 index f1d0f44..0000000 --- a/i18n/en-US/theme_switch.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "label": "Change Theme", - "system": "System", - "light": "Light", - "dark": "Dark" -} diff --git a/src/lib/shared/i18n/LocaleSwitch.svelte b/src/lib/shared/i18n/LocaleSwitch.svelte deleted file mode 100644 index 25cc1c6..0000000 --- a/src/lib/shared/i18n/LocaleSwitch.svelte +++ /dev/null @@ -1,33 +0,0 @@ - - -