From bd9444f9d34125f75b9c19dff1f3f557908e6f66 Mon Sep 17 00:00:00 2001 From: hellekin Date: Thu, 4 Jan 2018 22:13:26 +0100 Subject: Add FR/EN language switch --- assets/js/ps-app.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'assets/js') 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('') + $('#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 + }) + }); })($) -- cgit v1.2.3