detect and set language variable in local storage