Skip to content

Commit f3a4aeb

Browse files
Fix
1 parent 5340c02 commit f3a4aeb

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

_just/js/lang.js renamed to _just/js/lang1.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ SOFTWARE.
2626

2727
let Language;
2828
let upd = true;
29-
let prepathname = "/Encoder"
29+
let prepathname = "/Encoder";
30+
if (window.location.hostname != 'j.is-a.dev') {
31+
prepathname = "";
32+
}
3033

3134
if (!localStorage.getItem('Language') && window.location.search === '?en') {
3235
Language = 'en';
@@ -35,7 +38,7 @@ if (!localStorage.getItem('Language') && window.location.search === '?en') {
3538
} else if (!localStorage.getItem('Language') && window.location.search === '?ru') {
3639
Language = 'ru';
3740
localStorage.setItem('Language', Language);
38-
upd = false
41+
upd = false;
3942
}
4043

4144
if (localStorage.getItem('Language')) {

_just/js/lang2.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
let prepathname_ = "/Encoder";
2+
if (window.location.hostname != 'j.is-a.dev') {
3+
prepathname_ = "";
4+
}
5+
setInterval(()=>{
6+
let __lng__ = localStorage.getItem('Language') || "en";
7+
let __pth__ = window.location.pathname;
8+
if (__pth__ == `${prepathname_}` || __pth__ == `${prepathname_}/`) {
9+
if (__lng__ == "ru") {
10+
__pth__ = `${prepathname_}/ru`;
11+
}
12+
} else if (__pth__ == `${prepathname_}/ru`) {
13+
if (__lng__ == "en") {
14+
__pth__ = `${prepathname_}/`;
15+
}
16+
} else if (__pth__ == `${prepathname_}/en`) {
17+
if (__lng__ == "ru") {
18+
__pth__ = `${prepathname_}/ru`;
19+
} else if (__lng__ == "en") {
20+
__pth__ = `${prepathname_}/`;
21+
}
22+
}
23+
},10);

0 commit comments

Comments
 (0)