aboutsummaryrefslogtreecommitdiff
path: root/assets/js/ps-app.js
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2018-01-04 22:13:26 +0100
committerhellekin <hellekin@cepheide.org>2018-01-04 22:13:26 +0100
commitbd9444f9d34125f75b9c19dff1f3f557908e6f66 (patch)
tree0ceb3cea3e756c57bf431939c8f20a99ecaefc0c /assets/js/ps-app.js
parentb430a490e7c03b4d3cc9685ae410bd3478069ce6 (diff)
downloadlesoiseaux.io-bd9444f9d34125f75b9c19dff1f3f557908e6f66.tar.gz
Add FR/EN language switch
Diffstat (limited to 'assets/js/ps-app.js')
-rw-r--r--assets/js/ps-app.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/assets/js/ps-app.js b/assets/js/ps-app.js
index da6442e..7675ec4 100644
--- a/assets/js/ps-app.js
+++ b/assets/js/ps-app.js
@@ -23,6 +23,21 @@
return false
})
+ // EN/FR switch
+ $('footer')
+ .append('<button id="lang-switch" title="Read in English">EN</button>')
+ $('#lang-switch').click(function(e) {
+ var lang = $('html').attr('lang')
+ if (lang == 'fr') {
+ $('html').attr('lang', 'en')
+ $(e.target).html('FR').attr('title', 'Lire en français')
+ } else {
+ $('html').attr('lang', 'fr')
+ $(e.target).html('EN').attr('title', 'Read in English')
+ }
+ return false
+ })
+
});
})($)