mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
refactor: 🌐 Internationalize every string
This commit is contained in:
parent
8c3ddc2a28
commit
2ceee4827f
41 changed files with 932 additions and 428 deletions
|
|
@ -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
7
composables/Language.ts
Normal 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");
|
||||
};
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue