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

Proposed by Daniel Holbach on 2015-06-03
Status: Merged
Approved by: Daniel Holbach on 2015-06-03
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 on 2015-06-03
Daniel Holbach (community) Approve on 2015-06-03
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.
review: Approve (continuous-integration)
lp:~dholbach/help-app/1456929 updated on 2015-06-03
147. By Daniel Holbach on 2015-06-03

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

Daniel Holbach (dholbach) wrote :

<kalikiana> dholbach: looking very good now!

review: Approve
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