/*

let dl=get_localstorage('lang').data; // Default to English

console.log(dl)

if(dl.status==true) {

  let lang=dl.data;

  lang_change(lang);

} else {

  let lang='en';

  lang_change(lang);    

}



/*

document.addEventListener("DOMContentLoaded", () => {

  let lang=get_localstorage('lang').data;

  console.log('DOMContentLoaded')

  console.log(lang)

  lang_change(lang); // Apply initial translation

});



/*

document.addEventListener("DOMContentLoaded", () => {

  lang_change(lang); // Apply initial translation

  // Add event listeners to language switching buttons, e.g.:

  // document.getElementById('lang-en').addEventListener('click', () => changeLanguage('en'));

  // document.getElementById('lang-es').addEventListener('click', () => changeLanguage('es'));

});



/*

var lang='en';

lang_change(lang);

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

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

    transText(el, lang)

  });

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

    transPlaceholder(el, lang)

  });

});

/* */

/*

var lang=get_localstorage('lang').data || 'en';

lang_change(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)

  });

});



$(document).on('tab:open', async function (e) {

  console.log('app tab ready')

  

});

//console.log(lang)



/*

if(elang.status==true) {

  let lang+=elang.data

  console.log('lng: '+lang)

  lang_change(lang)

  Text();

} else {

  let lang+="en";

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

  lang_change(lang);

}

console.log('lang2+ '+lang)



Text();

/* */