summaryrefslogtreecommitdiff
path: root/src/web/app
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/app')
-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">