Commit ecaa597a authored by Jérome Perrin's avatar Jérome Perrin

officejs_support_request_ui: get selected language from settings

no need to to request server for this
parent e6d89583
......@@ -9,6 +9,7 @@
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getSettingList", "getSettingList")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
......@@ -158,12 +159,10 @@
})
.push(function () {
// set locale for momentjs
return gadget.jio_getAttachment(
'post_module',
gadget.hateoas_url + "/Localizer/get_selected_language",
{format: 'text'}
).push(function (lang) {
moment.locale(lang);
return gadget.getSettingList(["selected_language",
"default_selected_language"]
).push(function (lang_list) {
moment.locale(lang_list[0] || lang_list[1]);
});
})
.push(function () {
......
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1539132486.97</float>
<float>1539132630.18</float>
<string>GMT+9</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment