diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-08-22 02:25:41 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-22 02:25:41 +0900 |
| commit | 1ed189a51803c28fac2e0dcadaa85014cc8d3c3b (patch) | |
| tree | daaeb9c7572166e71e8d3c54be767fc631ce3453 /src/client | |
| parent | Merge branch 'master' of https://github.com/syuilo/misskey (diff) | |
| parent | Update index.js (diff) | |
| download | misskey-1ed189a51803c28fac2e0dcadaa85014cc8d3c3b.tar.gz misskey-1ed189a51803c28fac2e0dcadaa85014cc8d3c3b.tar.bz2 misskey-1ed189a51803c28fac2e0dcadaa85014cc8d3c3b.zip | |
Merge pull request #2386 from acid-chicken/patch-3
Update boot.js
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/boot.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 218d57d8ef..952881f6cb 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -32,13 +32,15 @@ //#region Detect app name let app = null; - if (url.pathname == '/docs' || url.pathname.startsWith('/docs/')) app = 'docs'; - if (url.pathname == '/dev' || url.pathname.startsWith('/dev/')) app = 'dev'; - if (url.pathname == '/auth' || url.pathname.startsWith('/auth/')) app = 'auth'; + if (`${url.pathname}/`.startsWith('/docs/')) app = 'docs'; + if (`${url.pathname}/`.startsWith('/dev/')) app = 'dev'; + if (`${url.pathname}/`.startsWith('/auth/')) app = 'auth'; //#endregion //#region Detect the user language - let lang = navigator.language.split('-')[0]; + let lang = navigator.language; + + if (!LANGS.includes(lang)) lang = lang.split('-')[0]; // The default language is English if (!LANGS.includes(lang)) lang = 'en'; |