Change translation on the fly

This commit is contained in:
Kushan Joshi
2017-01-16 11:49:06 +05:30
parent f33321d0e5
commit fb8efc2772

View File

@@ -298,6 +298,19 @@ export function uiInit(context) {
});
}
ui.restart = function(arg) {
context.container().selectAll('*').remove();
context.locale(arg);
context.loadLocale(function(err) {
if (!err) {
context.history().unlock();
render(context.container());
}
});
};
window.restart = ui.restart;
ui.sidebar = uiSidebar(context);
return ui;