Commit 8f4cae2f authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Change language only if available on website

parent 4d4d8524
...@@ -884,13 +884,14 @@ ...@@ -884,13 +884,14 @@
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getSetting("selected_language"), gadget.getSetting("selected_language"),
gadget.getSetting("default_selected_language") gadget.getSetting("default_selected_language"),
gadget.getSetting("language_map")
]); ]);
}) })
.push(function (results) { .push(function (results) {
if (results[1] !== results[0] && results[0]) { if (results[1] !== results[0] && results[0] && JSON.parse(results[2]).hasOwnProperty(results[0])) {
return gadget.redirect({ return gadget.redirect({
command: 'change_language', command: COMMAND_CHANGE_LANGUAGE,
options: { options: {
language: results[0] language: results[0]
} }
......
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.5821.18325.27016</string> </value> <value> <string>956.24559.34655.7219</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1482251886.14</float> <float>1483374652.65</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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