diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 6b008a3df8..bf23e44705 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -637,6 +637,15 @@ common/views/components/emoji-picker.vue: symbols: "記号" flags: "旗" +common/views/components/settings/app-type.vue: + title: "モード" + intro: "デスクトップ版とモバイル版のどちらを使うかを指定できます。" + choices: + auto: "自動で選択" + desktop: "デスクトップ版に固定" + mobile: "モバイル版に固定" + info: "変更はページの再度読み込み後に反映されます。" + common/views/components/signin.vue: username: "ユーザー名" password: "パスワード" diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 6cb1488e40..583cc4fc8b 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -84,7 +84,14 @@ // Detect the user agent const ua = navigator.userAgent.toLowerCase(); - const isMobile = /mobile|iphone|ipad|android/.test(ua); + let isMobile = /mobile|iphone|ipad|android/.test(ua) || window.innerWidth < 576; + if (settings && settings.device.appTypeForce) { + if (settings.device.appTypeForce === 'mobile') { + isMobile = true; + } else if (settings.device.appTypeForce === 'desktop') { + isMobile = false; + } + } // Get the
element const head = document.getElementsByTagName('head')[0]; diff --git a/src/client/app/common/views/components/settings/app-type.vue b/src/client/app/common/views/components/settings/app-type.vue new file mode 100644 index 0000000000..90ff28803b --- /dev/null +++ b/src/client/app/common/views/components/settings/app-type.vue @@ -0,0 +1,36 @@ + +{{ $t('intro') }}
+