mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-14 20:13:01 +03:00
19 lines
422 B
PHP
19 lines
422 B
PHP
<script>
|
|
window.lang = (function () {
|
|
const lang = <?= json_encode($this->lang->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>
|
|
|