const LANG = localStorage.getItem("lang") || "en";

const translations = {
en: {
login: "Login",
dashboard: "Dashboard",
workers: "Workers",
chat: "Chat",
logout: "Logout"
},
rs: {
login: "Prijava",
dashboard: "Kontrolna tabla",
workers: "Radnici",
chat: "Poruke",
logout: "Odjava"
}
};

function t(key){
return translations[LANG][key] || key;
}

function switchLang(){
let newLang = LANG === "en" ? "rs" : "en";
localStorage.setItem("lang", newLang);
location.reload();
}