Fix typecheck mismatch by mapping rqlite to sqlite and add Italian locale (#787)
Thanks for adding Italian locale support and fixing the rqlite dialect mapping, @fraluc06!
This commit is contained in:
1 parent
9858fc40d2
commit
28e8a77fa3
3 files changed
+1963
-2
No files matched your search
@@ -2,19 +2,20 @@ import { createI18n } from "vue-i18n";
|
||||
import zhCN from "./locales/zh-CN";
|
||||
import { safeLocalStorageGet, safeLocalStorageSet } from "@/lib/safeStorage";
|
||||
|
||||
export type Locale = "en" | "es" | "zh-CN" | "zh-TW";
|
||||
export type Locale = "en" | "es" | "it" | "zh-CN" | "zh-TW";
|
||||
type LocaleMessages = Record<string, unknown>;
|
||||
type I18nGlobal = {
|
||||
locale: { value: Locale };
|
||||
setLocaleMessage: (locale: Locale, messages: LocaleMessages) => void;
|
||||
};
|
||||
|
||||
const supportedLocales: Locale[] = ["en", "es", "zh-CN", "zh-TW"];
|
||||
const supportedLocales: Locale[] = ["en", "es", "it", "zh-CN", "zh-TW"];
|
||||
const defaultLocale: Locale = "zh-CN";
|
||||
const loadedLocales = new Set<Locale>([defaultLocale]);
|
||||
const localeLoaders: Record<Exclude<Locale, "zh-CN">, () => Promise<{ default: LocaleMessages }>> = {
|
||||
en: () => import("./locales/en"),
|
||||
es: () => import("./locales/es"),
|
||||
it: () => import("./locales/it"),
|
||||
"zh-TW": () => import("./locales/zh-TW"),
|
||||
};
|
||||
|
||||
@@ -41,6 +42,7 @@ export function localeFromLanguageTag(value: string | null | undefined): Locale
|
||||
}
|
||||
if (normalized === "en" || normalized.startsWith("en-")) return "en";
|
||||
if (normalized === "es" || normalized.startsWith("es-")) return "es";
|
||||
if (normalized === "it" || normalized.startsWith("it-")) return "it";
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user