Skip to content

Commit

Permalink
[home] set of folders for localized templates
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadushkin committed Oct 2, 2024
1 parent 27fcd9f commit 9aa8676
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion common/loginpage/src/paneltemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,20 @@
window.sdk.on('onaddtemplates', _on_add_templates.bind(this));

_init_collection.call(this);
window.sdk.LocalFileTemplates();

const _reload_templates = l => {
let ls = [l];
if (utils.Lang.id.length > 2) {
ls.push(l[3] == '_' ? l.replaceAll('_', '-') : l.replaceAll('_', '-'), l.substring(0,2));
}
ls.push("en-US","en_US","en");
window.sdk.LocalFileTemplates(ls);
};
_reload_templates(utils.Lang.id);

CommonEvents.on('lang:changed', (ol, nl) => {
_reload_templates(nl);
});

return this;
}
Expand Down

0 comments on commit 9aa8676

Please sign in to comment.