From d2020cafecc6b68d3f748d8a1eec9bf4e6ad7ce8 Mon Sep 17 00:00:00 2001 From: Benjamin Singleton <19498453+tetrogem@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:33:35 -0600 Subject: [PATCH] wip: fixed issues with i18n fallbacking for value-type objects/arrays, removed i18n integration and replaced with proprietary implementation again --- apps/vdn-static/src/App.vue | 6 +- .../src/components/atoms/I18nTemplate.vue | 45 --- .../src/components/atoms/RichTemplate.vue | 74 ++++- .../components/atoms/RichTemplateParts.vue | 41 +-- .../molecules/DiscordRuleOverview.vue | 9 +- .../molecules/DiscordRuleSection.vue | 7 +- .../src/components/organisms/LocalePicker.vue | 8 +- apps/vdn-static/src/i18n/index.ts | 296 ++++++++++++------ apps/vdn-static/src/i18n/locale.ts | 87 +++-- apps/vdn-static/src/i18n/marker.ts | 47 ++- apps/vdn-static/src/i18n/rich.ts | 8 +- apps/vdn-static/src/locales/en_US.ts | 164 +++++----- apps/vdn-static/src/locales/vp_VL.ts | 19 +- apps/vdn-static/src/locales/wp_VL.ts | 78 ++--- apps/vdn-static/src/main.ts | 3 +- apps/vdn-static/src/pages/discord/rules.vue | 31 +- apps/vdn-static/src/pages/index.vue | 8 +- apps/vdn-static/src/pages/kotoba.vue | 8 +- apps/vdn-static/src/pages/resources.vue | 10 +- 19 files changed, 529 insertions(+), 420 deletions(-) delete mode 100644 apps/vdn-static/src/components/atoms/I18nTemplate.vue diff --git a/apps/vdn-static/src/App.vue b/apps/vdn-static/src/App.vue index 012c225..73de324 100644 --- a/apps/vdn-static/src/App.vue +++ b/apps/vdn-static/src/App.vue @@ -7,9 +7,9 @@ import { useRouter } from "vue-router"; import SmartLink from "./components/atoms/SmartLink.vue"; import type { SmartDest } from "./utils/smart-dest"; import type { Locale } from "./i18n/locale"; -import { useI18n } from "./i18n"; +import { useLocale } from "./i18n"; -const i18n = useI18n(); +const locale = useLocale(); const burgerOpen: Ref = ref(false); @@ -39,7 +39,7 @@ const NAVBAR_ITEM_ORDER = [ const navbarItems = computed(() => NAVBAR_ITEM_ORDER.map((id): NavbarItem => { - const label = i18n.t(`navbar.${id}`); + const label = locale.value.navbar[id]; const to = ((): SmartDest => { switch (id) { diff --git a/apps/vdn-static/src/components/atoms/I18nTemplate.vue b/apps/vdn-static/src/components/atoms/I18nTemplate.vue deleted file mode 100644 index 5e6c689..0000000 --- a/apps/vdn-static/src/components/atoms/I18nTemplate.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - diff --git a/apps/vdn-static/src/components/atoms/RichTemplate.vue b/apps/vdn-static/src/components/atoms/RichTemplate.vue index f68b32b..35355fa 100644 --- a/apps/vdn-static/src/components/atoms/RichTemplate.vue +++ b/apps/vdn-static/src/components/atoms/RichTemplate.vue @@ -1,29 +1,79 @@