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
1=== modified file 'static/index.html'
2--- static/index.html 2015-03-19 13:22:42 +0000
3+++ static/index.html 2015-06-03 11:06:32 +0000
4@@ -86,8 +86,21 @@
5 $.ajax({
6 url: "index." + language + ".html",
7 error: function(data){
8- console.log("No translations for " + language + " available. Fall back to en-us.")
9- language = "en-us";
10+ var langFlavour = language;
11+ // If the language doesn't have the specific flavour, try
12+ // the general language instead, ie: turn "de-DE" into "de".
13+ language = language.slice(0, language.indexOf("-"));
14+ console.log("No translations for language flavour " + langFlavour + " available. "+
15+ "Falling back to general language " + language + ".");
16+ $.ajax({
17+ url: "index." + language + ".html",
18+ error: function(data){
19+ console.log("No translations for language " + language + " available. "+
20+ "Falling back to en-us.");
21+ language = "en-us";
22+ },
23+ async: false
24+ })
25 },
26 async: false
27 });

Subscribers

People subscribed via source and target branches