summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-23 05:53:09 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-23 05:53:09 +0900
commitabb8e021ba776a9e9c400a2bfab2c220ec8316e5 (patch)
tree1b37ee7c208bf375ca2d459698e65dcb9d738e17 /src
parentFix bug (diff)
downloadsharkey-abb8e021ba776a9e9c400a2bfab2c220ec8316e5.tar.gz
sharkey-abb8e021ba776a9e9c400a2bfab2c220ec8316e5.tar.bz2
sharkey-abb8e021ba776a9e9c400a2bfab2c220ec8316e5.zip
wip #313
Diffstat (limited to 'src')
-rw-r--r--src/web/app/client/script.js8
-rw-r--r--src/web/app/desktop/tags/ui-header-nav.tag2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/web/app/client/script.js b/src/web/app/client/script.js
index 0f0fd7aa45..876d2c1694 100644
--- a/src/web/app/client/script.js
+++ b/src/web/app/client/script.js
@@ -4,6 +4,10 @@
(() => {
const head = document.getElementsByTagName('head')[0];
+ // Detect user language
+ let lang = (navigator.languages && navigator.languages[0]) || navigator.language;
+ if (!/en|en\-US|ja/.test(lang)) lang = 'en';
+
// Detect user agent
const ua = navigator.userAgent.toLowerCase();
const isMobile = /mobile|iphone|ipad|android/.test(ua);
@@ -15,7 +19,7 @@
*/
function mountDesktop() {
const script = document.createElement('script');
- script.setAttribute('src', `/assets/desktop/script.${VERSION}.js`);
+ script.setAttribute('src', `/assets/desktop/script.${VERSION}.${lang}.js`);
script.setAttribute('async', 'true');
script.setAttribute('defer', 'true');
head.appendChild(script);
@@ -31,7 +35,7 @@
head.appendChild(meta);
const script = document.createElement('script');
- script.setAttribute('src', `/assets/mobile/script.${VERSION}.js`);
+ script.setAttribute('src', `/assets/mobile/script.${VERSION}.${lang}.js`);
script.setAttribute('async', 'true');
script.setAttribute('defer', 'true');
head.appendChild(script);
diff --git a/src/web/app/desktop/tags/ui-header-nav.tag b/src/web/app/desktop/tags/ui-header-nav.tag
index 447dcf2388..5ffa392f5c 100644
--- a/src/web/app/desktop/tags/ui-header-nav.tag
+++ b/src/web/app/desktop/tags/ui-header-nav.tag
@@ -3,7 +3,7 @@
<li class="home { active: page == 'home' }">
<a href={ CONFIG.url }>
<i class="fa fa-home"></i>
- <p>ホーム</p>
+ <p>'i18n:home'</p>
</a>
</li>
<li class="messaging">