wip: fixed issues with i18n fallbacking for value-type objects/arrays, removed i18n integration and replaced with proprietary implementation again

This commit is contained in:
Benjamin Singleton 2026-02-15 23:33:35 -06:00
parent 771a8cc4bf
commit d2020cafec
19 changed files with 529 additions and 420 deletions

View file

@ -1,13 +1,13 @@
<script setup lang="ts">
import HomeSectionWrapper from "@/components/molecules/HomeSectionWrapper.vue";
import { useI18n } from "@/i18n";
import { useLocale } from "@/i18n";
import { GREETINGS, type Greeting } from "@/i18n/greeting";
import type { Locale } from "@/i18n/locale";
import { VILANTIC_ID_TO_FLAG } from "@/i18n/vilantic";
import { randomElement } from "@/utils/random";
import { computed } from "vue";
const i18n = useI18n();
const locale = useLocale();
const greeting: Greeting = randomElement(GREETINGS);
@ -18,7 +18,7 @@ const SECTION_ORDER = [
] as const satisfies (keyof Locale["home"]["sections"])[];
const sections = computed(() =>
SECTION_ORDER.map((id) => i18n.v(`home.sections.${id}`)),
SECTION_ORDER.map((id) => locale.value.home.sections[id]),
);
</script>
@ -35,7 +35,7 @@ const sections = computed(() =>
<div
class="subtitle is-size-6 is-flex is-flex-direction-row is-align-items-center is-gap-1 has-text-text-bold">
&mdash; {{ greeting.author }} ({{
i18n.v("vilanticLangs")[greeting.lang]
locale.vilanticLangs[greeting.lang]
}})
<figure class="image is-32x32">
<img :src="VILANTIC_ID_TO_FLAG[greeting.lang]" />