Skip to content

Commit 540eeb3

Browse files
Fix
1 parent 9e3e871 commit 540eeb3

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

_just/js/copyright.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const currentYear = new Date().getFullYear();
4545
const copyrightText = `
4646
<span style="${copyrightTextStyles}">
4747
<a href="${copyrightTextLink}" target="_blank">
48-
<span style="opacity: 0.5;text-decoration: underline;text-decoration-color: rgba(255,255,255,0.33);" class="txt12" id="copyrightfootertext">© 2025-${__just.currentYear} JustStudio.</span>
48+
<span style="opacity: 0.5;text-decoration: underline;text-decoration-color: rgba(255,255,255,0.33);" class="txt12" id="copyrightfootertext">© 2025-${currentYear} JustStudio.</span>
4949
</a>
5050
<br>
5151
</span>

_just/js/lang.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,30 @@ SOFTWARE.
2525
*/
2626

2727
let Language;
28-
29-
if (localStorage.getItem('Language')) {
30-
Language = localStorage.getItem('Language');
31-
} else {
32-
const userLang = navigator.language || navigator.userLanguage;
33-
Language = userLang.includes('ru') ? 'ru' : 'en';
34-
localStorage.setItem('Language', Language);
35-
}
28+
let upd = true;
3629

3730
if (!localStorage.getItem('Language') && window.location.search === '?en') {
3831
Language = 'en';
3932
localStorage.setItem('Language', Language);
33+
upd = false;
4034
} else if (!localStorage.getItem('Language') && window.location.search === '?ru') {
4135
Language = 'ru';
4236
localStorage.setItem('Language', Language);
37+
upd = false
38+
}
39+
40+
if (localStorage.getItem('Language')) {
41+
Language = localStorage.getItem('Language');
42+
} else {
43+
const userLang = navigator.language || navigator.userLanguage;
44+
Language = userLang.includes('ru') ? 'ru' : 'en';
45+
if (upd) {
46+
localStorage.setItem('Language', Language);
47+
}
4348
}
4449

45-
if (window.location.pathname.endsWith('/en') && Language === 'en') {
46-
window.location.pathname = window.location.pathname.replace(/\/en$/, '');
50+
if (!(window.location.pathname.endsWith('/')) && window.location.pathname.endsWith('/en') && Language === 'en') {
51+
window.location.pathname = window.location.pathname.replace(/\/en$/, '/');
4752
} else if (Language === 'ru' && !window.location.pathname.endsWith('/ru')) {
4853
window.location.pathname = window.location.pathname.replace(/\/en$/, '/ru') || window.location.pathname + 'ru';
4954
}

0 commit comments

Comments
 (0)