mirror of
https://github.com/NotXia/notxia.github.io.git
synced 2025-12-17 20:01:52 +01:00
Add locale handling
This commit is contained in:
7
src/utilities/locale_handler.ts
Normal file
7
src/utilities/locale_handler.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export function getLocale():string {
|
||||
return localStorage.getItem("locale") ?? window.navigator.language.split("-")[0];
|
||||
}
|
||||
|
||||
export function setLocale(locale:string):void {
|
||||
localStorage.setItem("locale", locale);
|
||||
}
|
||||
Reference in New Issue
Block a user