var DEFAULT_LANG="fr";console.log("DEFAULT_LANG = ",DEFAULT_LANG);var LANG_REG_EXP=/\[\[([a-z]{2})\]\]([^\[]+)/g,isStorageEnabled=!("undefined"==typeof localStorage),possibleLang=[],user_lang=(navigator.userLanguage||navigator.browserLanguage||navigator.language||DEFAULT_LANG).substr(0,2);console.log("browser lang = ",user_lang),localStorage.getItem("lang")&&(user_lang=localStorage.getItem("lang"),console.log("storage lang = ",localStorage.getItem("lang")));var setLang=function(a){isStorageEnabled&&localStorage.setItem("lang",a);for(const e of possibleLang)e!=a?$("[is-lang="+e+"]").hide():showContent(e)},showContent=function(a){$("[is-lang="+a+"]").show(),$(".lang-"+a).addClass("active").siblings().removeClass("active"),$("[is-"+a+"]").each((function(){var e=$(this).attr("is-"+a);$(this).text(e)})),$("[is-"+a+"-shadow]").each((function(){var e=$(this).attr("is-"+a+"-shadow");$(this).attr("placeholder",e)})),$("[is-"+a+"-button]").each((function(){var e=$(this).attr("is-"+a+"-button");$(this).attr("value",e)})),$("[is-"+a+"-wait]").each((function(){var e=$(this).attr("is-"+a+"-wait");$(this).attr("data-wait",e)}))};$(".lang ."+user_lang).addClass("active").siblings().removeClass("active"),$(document).ready((function(){$(".lang .lang-select").each((function(){var a=$(this).attr("setLang");possibleLang.push(a),a!=user_lang?$("[is-lang="+a+"]").hide():showContent(a)})),possibleLang.includes(user_lang)||showContent(user_lang=DEFAULT_LANG),$(".lang-select").click((function(){setLang($(this).attr("setLang"))})),$(window).keydown((function(a){a.ctrlKey&&"e"==a.key?(a.preventDefault(),setLang("en"),console.log("-- english")):a.ctrlKey&&"f"==a.key?(a.preventDefault(),setLang("fr"),console.log("-- française")):a.ctrlKey&&"d"==a.key&&(a.preventDefault(),setLang("de"),console.log("-- deutsch"))})),console.log("lang plugin loaded")}));