Merge branch 'canary' into fa-locale

This commit is contained in:
Mauricio Siu
2024-11-28 20:45:24 -06:00
34 changed files with 5399 additions and 595 deletions

View File

@@ -1,27 +1,29 @@
import Cookies from "js-cookie";
const SUPPORTED_LOCALES = [
"en",
"pl",
"ru",
"de",
"zh-Hant",
"zh-Hans",
"fa",
"en",
"pl",
"ru",
"fr",
"de",
"tr",
"zh-Hant",
"zh-Hans",
"fa",
] as const;
type Locale = (typeof SUPPORTED_LOCALES)[number];
export default function useLocale() {
const currentLocale = (Cookies.get("DOKPLOY_LOCALE") ?? "en") as Locale;
const currentLocale = (Cookies.get("DOKPLOY_LOCALE") ?? "en") as Locale;
const setLocale = (locale: Locale) => {
Cookies.set("DOKPLOY_LOCALE", locale, { expires: 365 });
window.location.reload();
};
const setLocale = (locale: Locale) => {
Cookies.set("DOKPLOY_LOCALE", locale, { expires: 365 });
window.location.reload();
};
return {
locale: currentLocale,
setLocale,
};
return {
locale: currentLocale,
setLocale,
};
}