Files
easyappointments/application/views/components/js_lang_script.php
xavor 8c4798a5fd
Some checks failed
CI / build-test (push) Has been cancelled
first commit
2025-05-31 18:56:37 +02:00

20 lines
422 B
PHP

<script>
window.lang = (function () {
const lang = <?= json_encode(html_vars('language')) ?>;
return (key) => {
if (!key) {
return lang;
}
if (!lang[key]) {
console.error(`Cannot find translation for requested key: "${key}"`);
return key;
}
return lang[key];
};
})();
</script>