Skip to content

Commit be55c40

Browse files
committed
auto browser langauge reload on page
1 parent f0cac5b commit be55c40

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

proxy/js/ui.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ function getFlagEmoji(countryCode) {
5454
return String.fromCodePoint(...codePoints);
5555
}
5656

57-
const locale = new Intl.Locale(navigator.language);
57+
let locale = new Intl.Locale(navigator.language);
58+
window.addEventListener('languagechange', () => {
59+
locale = new Intl.Locale(navigator.language);
60+
console.info(`Browser language changed to ${locale.language}`);
61+
onStyleChange();
62+
})
5863

5964
const icons = {
6065
railway: {

0 commit comments

Comments
 (0)