summaryrefslogtreecommitdiff
path: root/usr/share/swiftstory/www/swiftstory-config.js
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2018-03-09 13:38:23 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2018-03-09 13:38:23 +0100
commit8da3b6f8e31e1c9cf40e3f5ffd25316d5bce5944 (patch)
treea063ba34996e4754274bbcd28c104edb380717a9 /usr/share/swiftstory/www/swiftstory-config.js
parent899b6558513e9d5920a1525aefb9e3ac21349142 (diff)
moved webapp files in the usr/share/swiftstory dir
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'usr/share/swiftstory/www/swiftstory-config.js')
-rw-r--r--usr/share/swiftstory/www/swiftstory-config.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/usr/share/swiftstory/www/swiftstory-config.js b/usr/share/swiftstory/www/swiftstory-config.js
new file mode 100644
index 0000000..9a6be3c
--- /dev/null
+++ b/usr/share/swiftstory/www/swiftstory-config.js
@@ -0,0 +1,13 @@
+$(document).ready(function() {
+ var lang;
+ var hostname = document.location.hostname;
+
+ /* XXX replace this with your desired behaviour */
+ if (hostname.substring(0, 3) === 'fr.') {
+ lang = 'fr';
+ } else if (hostname.substring(0, 3) === 'en.') {
+ lang = 'en';
+ }
+
+ swst.set_lang(lang);
+});