fix locale 404 not default
This commit is contained in:
parent
34f2d0e24a
commit
8d8b4818ae
@ -92816,7 +92816,8 @@ var PageRoot = function (_React$Component) {
|
|||||||
return response.json();
|
return response.json();
|
||||||
}).then(function (json) {
|
}).then(function (json) {
|
||||||
if (json.status != 1) return location.replace('/');
|
if (json.status != 1) return location.replace('/');
|
||||||
var lang = navigator.language.substring(0, 2);
|
var slang = sessionStorage.getItem('lang');
|
||||||
|
var lang = slang || navigator.language.substring(0, 2);
|
||||||
fetch('/locales/' + lang + '.json').then(function (response) {
|
fetch('/locales/' + lang + '.json').then(function (response) {
|
||||||
if (response.status == 200) return response.json();
|
if (response.status == 200) return response.json();
|
||||||
return {};
|
return {};
|
||||||
|
@ -39,7 +39,8 @@ class PageRoot extends React.Component {
|
|||||||
.then(response=>response.json())
|
.then(response=>response.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if(json.status != 1) return location.replace('/');
|
if(json.status != 1) return location.replace('/');
|
||||||
let lang = navigator
|
let slang = sessionStorage.getItem('lang');
|
||||||
|
let lang = slang || navigator
|
||||||
.language
|
.language
|
||||||
.substring(0, 2);
|
.substring(0, 2);
|
||||||
fetch(`/locales/${lang}.json`).then(response => {
|
fetch(`/locales/${lang}.json`).then(response => {
|
||||||
|
Loading…
Reference in New Issue
Block a user