function lang_change(lang) {

  remove_localstorage('lang');

  set_localstorage('lang',lang)

  console.log('set lang to: '+lang)

  Text(lang);

  document.querySelectorAll("[data-lang]").forEach(el=> {

    transText(el, lang)

  });

  document.querySelectorAll("[data-ph_lang]").forEach(el=> {

    transPlaceholder(el, lang)

  });  

  

$(document).on('page:beforein', async function(e) {

  //console.log('page:beforein')

  document.querySelectorAll("[data-lang]").forEach(el=> {

    transText(el, lang)

  });

  document.querySelectorAll("[data-ph_lang]").forEach(el=> {

    transPlaceholder(el, lang)

  });

});

};