Web app to Svelte5 (#540)

This commit is contained in:
Brahim Hadriche authored and GitHub committed 2025-01-09 21:22:34 -05:00
1 parent 9eeb9fcffe
commit c534c27ae3
35 files changed
+1724 -2331

No files matched your search

+4 -4
View File
@@ -1,4 +1,4 @@
import { tr } from "lib/Stores";
import { translate } from "lib/Stores";
import { PlayletApi } from "./PlayletApi";
import { get } from "svelte/store";
@@ -31,14 +31,14 @@ export async function fetchLocale(locale: string) {
}
translations[source[0].textContent] = translation[0].textContent;
}
tr.set((s) => translations[s] || s);
translate.set((s) => translations[s] || s);
} catch (error) {
console.error(error);
}
}
export function getPluralString(c: number, zeroString: string, oneString: string, pluralString: string) {
const trFn = get(tr);
const trFn = get(translate);
c = c || 0;
if (c === 0) {
@@ -51,7 +51,7 @@ export function getPluralString(c: number, zeroString: string, oneString: string
}
export function getFormattedPluralString(c: number, zeroString: string, oneString: string, pluralString: string) {
const trFn = get(tr);
const trFn = get(translate);
c = c || 0;
if (c === 0) {