diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 6b008a3df..bf23e4470 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 6cb1488e4..583cc4fc8 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 000000000..90ff28803 --- /dev/null +++ b/src/client/app/common/views/components/settings/app-type.vue @@ -0,0 +1,36 @@ + + + diff --git a/src/client/app/common/views/components/settings/settings.vue b/src/client/app/common/views/components/settings/settings.vue index 1254eb5e5..5f370c8be 100644 --- a/src/client/app/common/views/components/settings/settings.vue +++ b/src/client/app/common/views/components/settings/settings.vue @@ -163,6 +163,7 @@ +