Merge lp:~dholbach/help-app/1456929 into lp:help-app

Proposed by Daniel Holbach
Status: Merged
Approved by: Daniel Holbach
Approved revision: 147
Merged at revision: 146
Proposed branch: lp:~dholbach/help-app/1456929
Merge into: lp:help-app
Diff against target: 27 lines (+15/-2)
1 file modified
static/index.html (+15/-2)
To merge this branch: bzr merge lp:~dholbach/help-app/1456929
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Daniel Holbach (community) Approve
Review via email: mp+260920@code.launchpad.net

Commit message

change language specifiers like 'de-DE' into 'de'

Description of the change

change language specifiers like 'de-DE' into 'de'

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
lp:~dholbach/help-app/1456929 updated
147. By Daniel Holbach

try de-DE, then fall back to de, then fall back to en-us - thanks Christian Dywan for the review

Revision history for this message
Daniel Holbach (dholbach) wrote :

<kalikiana> dholbach: looking very good now!

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'static/index.html'
--- static/index.html 2015-03-19 13:22:42 +0000
+++ static/index.html 2015-06-03 11:06:32 +0000
@@ -86,8 +86,21 @@
86 $.ajax({86 $.ajax({
87 url: "index." + language + ".html",87 url: "index." + language + ".html",
88 error: function(data){88 error: function(data){
89 console.log("No translations for " + language + " available. Fall back to en-us.")89 var langFlavour = language;
90 language = "en-us";90 // If the language doesn't have the specific flavour, try
91 // the general language instead, ie: turn "de-DE" into "de".
92 language = language.slice(0, language.indexOf("-"));
93 console.log("No translations for language flavour " + langFlavour + " available. "+
94 "Falling back to general language " + language + ".");
95 $.ajax({
96 url: "index." + language + ".html",
97 error: function(data){
98 console.log("No translations for language " + language + " available. "+
99 "Falling back to en-us.");
100 language = "en-us";
101 },
102 async: false
103 })
91 },104 },
92 async: false105 async: false
93 });106 });

Subscribers

People subscribed via source and target branches