mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
17 lines
390 B
TypeScript
17 lines
390 B
TypeScript
import type { Languages } from "@/lib/languages";
|
|
import Cookies from "js-cookie";
|
|
|
|
export default function useLocale() {
|
|
const currentLocale = (Cookies.get("DOKPLOY_LOCALE") ?? "en") as Languages;
|
|
|
|
const setLocale = (locale: Languages) => {
|
|
Cookies.set("DOKPLOY_LOCALE", locale, { expires: 365 });
|
|
window.location.reload();
|
|
};
|
|
|
|
return {
|
|
locale: currentLocale,
|
|
setLocale,
|
|
};
|
|
}
|