feat: implemented new i18n system

This commit is contained in:
Benjamin Singleton 2025-06-14 11:57:28 -05:00
parent 4b4e8b7aa8
commit 032cfb2bfd
11 changed files with 254 additions and 124 deletions

View file

@ -0,0 +1,16 @@
import type { Layout } from "@/i18n/locale";
import type { DeepReadonly } from "vue";
export function localizeLayout<T>(
layout: DeepReadonly<Layout<T>>,
): T[keyof T][] {
const sections: T[keyof T][] = [];
for (const sectionId of layout.layout) {
const section = (layout.data as T)[sectionId as keyof T];
if (section) {
sections.push(section);
}
}
return sections;
}