dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #32376
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16527: PT DV GIS ER EV i18n fallback.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 16527 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-08-26 15:53:11 +0200
message:
PT DV GIS ER EV i18n fallback.
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/app/scripts/app.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/app/scripts/app.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/app/scripts/app.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/app/scripts/app.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/app/scripts/app.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/app/scripts/app.js 2014-08-26 12:20:36 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/app/scripts/app.js 2014-08-26 13:52:18 +0000
@@ -7108,15 +7108,27 @@
requests.push({
url: init.contextPath + '/api/me/user-account.json',
success: function(r) {
- var defaultKeyUiLocale = 'en';
+ var defaultKeyUiLocale = 'en';
init.keyUiLocale = Ext.decode(r.responseText).settings.keyUiLocale || defaultKeyUiLocale;
-
+
// i18n
Ext.Ajax.request({
url: 'i18n/' + init.keyUiLocale + '.json',
success: function(r) {
NS.i18n = Ext.decode(r.responseText);
- fn();
+
+ if (init.keyUiLocale !== defaultKeyUiLocale) {
+ Ext.Ajax.request({
+ url: 'i18n/' + defaultKeyUiLocale + '.json',
+ success: function(r) {
+ Ext.applyIf(NS.i18n, Ext.decode(r.responseText));
+ },
+ callback: fn
+ })
+ }
+ else {
+ fn();
+ }
},
failure: function() {
var failure = function() {
@@ -7133,9 +7145,7 @@
failure: function() {
failure();
},
- callback: function() {
- fn();
- }
+ callback: fn
});
}
else {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/app/scripts/app.js 2014-08-26 12:18:42 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/app/scripts/app.js 2014-08-26 13:52:18 +0000
@@ -6744,15 +6744,27 @@
requests.push({
url: init.contextPath + '/api/me/user-account.json',
success: function(r) {
- var defaultKeyUiLocale = 'en';
+ var defaultKeyUiLocale = 'en';
init.keyUiLocale = Ext.decode(r.responseText).settings.keyUiLocale || defaultKeyUiLocale;
-
+
// i18n
Ext.Ajax.request({
url: 'i18n/' + init.keyUiLocale + '.json',
success: function(r) {
NS.i18n = Ext.decode(r.responseText);
- fn();
+
+ if (init.keyUiLocale !== defaultKeyUiLocale) {
+ Ext.Ajax.request({
+ url: 'i18n/' + defaultKeyUiLocale + '.json',
+ success: function(r) {
+ Ext.applyIf(NS.i18n, Ext.decode(r.responseText));
+ },
+ callback: fn
+ })
+ }
+ else {
+ fn();
+ }
},
failure: function() {
var failure = function() {
@@ -6769,9 +6781,7 @@
failure: function() {
failure();
},
- callback: function() {
- fn();
- }
+ callback: fn
});
}
else {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/app/scripts/app.js 2014-08-26 12:21:53 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/app/scripts/app.js 2014-08-26 13:52:18 +0000
@@ -9183,7 +9183,19 @@
url: 'i18n/' + init.keyUiLocale + '.json',
success: function(r) {
GIS.i18n = Ext.decode(r.responseText);
- fn();
+
+ if (init.keyUiLocale !== defaultKeyUiLocale) {
+ Ext.Ajax.request({
+ url: 'i18n/' + defaultKeyUiLocale + '.json',
+ success: function(r) {
+ Ext.applyIf(NS.i18n, Ext.decode(r.responseText));
+ },
+ callback: fn
+ })
+ }
+ else {
+ fn();
+ }
},
failure: function() {
var failure = function() {
@@ -9200,9 +9212,7 @@
failure: function() {
failure();
},
- callback: function() {
- fn();
- }
+ callback: fn
});
}
else {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2014-08-26 12:16:56 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2014-08-26 13:48:45 +0000
@@ -6196,15 +6196,27 @@
requests.push({
url: init.contextPath + '/api/me/user-account.json',
success: function(r) {
- var defaultKeyUiLocale = 'en';
+ var defaultKeyUiLocale = 'en';
init.keyUiLocale = Ext.decode(r.responseText).settings.keyUiLocale || defaultKeyUiLocale;
-
+
// i18n
Ext.Ajax.request({
url: 'i18n/' + init.keyUiLocale + '.json',
success: function(r) {
NS.i18n = Ext.decode(r.responseText);
- fn();
+
+ if (init.keyUiLocale !== defaultKeyUiLocale) {
+ Ext.Ajax.request({
+ url: 'i18n/' + defaultKeyUiLocale + '.json',
+ success: function(r) {
+ Ext.applyIf(NS.i18n, Ext.decode(r.responseText));
+ },
+ callback: fn
+ })
+ }
+ else {
+ fn();
+ }
},
failure: function() {
var failure = function() {
@@ -6221,9 +6233,7 @@
failure: function() {
failure();
},
- callback: function() {
- fn();
- }
+ callback: fn
});
}
else {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2014-08-26 12:17:50 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2014-08-26 13:52:18 +0000
@@ -6089,15 +6089,27 @@
requests.push({
url: init.contextPath + '/api/me/user-account.json',
success: function(r) {
- var defaultKeyUiLocale = 'en';
+ var defaultKeyUiLocale = 'en';
init.keyUiLocale = Ext.decode(r.responseText).settings.keyUiLocale || defaultKeyUiLocale;
-
+
// i18n
Ext.Ajax.request({
url: 'i18n/' + init.keyUiLocale + '.json',
success: function(r) {
NS.i18n = Ext.decode(r.responseText);
- fn();
+
+ if (init.keyUiLocale !== defaultKeyUiLocale) {
+ Ext.Ajax.request({
+ url: 'i18n/' + defaultKeyUiLocale + '.json',
+ success: function(r) {
+ Ext.applyIf(NS.i18n, Ext.decode(r.responseText));
+ },
+ callback: fn
+ })
+ }
+ else {
+ fn();
+ }
},
failure: function() {
var failure = function() {
@@ -6114,9 +6126,7 @@
failure: function() {
failure();
},
- callback: function() {
- fn();
- }
+ callback: fn
});
}
else {