refactor: 🌐 Internationalize every string

This commit is contained in:
Jesse Wierzbinski 2024-12-07 22:17:22 +01:00
parent 8c3ddc2a28
commit 2ceee4827f
No known key found for this signature in database
41 changed files with 932 additions and 428 deletions

View file

@ -1,5 +1,7 @@
import type { Client } from "@versia/client";
import type { RolePermission } from "@versia/client/types";
import { toast } from "vue-sonner";
import * as m from "~/paraglide/messages.js";
export const useCacheRefresh = (client: MaybeRef<Client | null>) => {
// Refresh custom emojis and instance data and me on every reload
@ -21,11 +23,8 @@ export const useCacheRefresh = (client: MaybeRef<Client | null>) => {
if (code === 401) {
// Reset tokenData
identity.value = null;
useEvent("notification:new", {
type: "error",
title: "Your session has expired",
description:
"You have been logged out. Please log in again.",
toast.error(m.fancy_this_wasp_renew(), {
description: m.real_weird_deer_stop(),
});
}
});

7
composables/Language.ts Normal file
View file

@ -0,0 +1,7 @@
import { SettingIds } from "~/settings";
export const useLanguage = () => {
const lang = useSetting(SettingIds.Language);
return computed(() => lang.value.value as "en" | "fr");
};

View file

@ -7,7 +7,7 @@ import {
} from "~/settings";
const useSettings = () => {
return useLocalStorage<Settings>("versia:settings", settingsJson, {
return useLocalStorage<Settings>("versia:settings", settingsJson(), {
serializer: {
read(raw) {
const json = StorageSerializers.object.read(raw);