Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support per-language CSS / fonts (for Japanese etc) #2271

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html i18n_lang="currentLanguage">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Expand Down
12 changes: 12 additions & 0 deletions js/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ i18n.localize = function (reTranslate = false) {
const element = $(this);
element.attr('placeholder', translate(element.attr('i18n_placeholder')));
});

$('[i18n_lang]').each(function() {
const element = $(this);
element.attr('lang', translate(element.attr('i18n_lang')));
});
} else {

$('[i18n]:not(.i18n-replaced)').each(function() {
Expand Down Expand Up @@ -234,6 +239,13 @@ i18n.localize = function (reTranslate = false) {
element.attr('placeholder', translate(element.attr('i18n_placeholder')));
element.addClass('i18n_placeholder-replaced');
});

$('[i18n_lang]:not(.i18n_lang-replaced)').each(function() {
const element = $(this);
element.attr('lang', translate(element.attr('i18n_lang')));
element.addClass('i18n_lang-replaced');
});

}

return localized;
Expand Down
3 changes: 3 additions & 0 deletions locale/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6156,5 +6156,8 @@
},
"adsbHeartbeatTotalMessages": {
"message": "Heartbeat msgs"
},
"currentLanguage": {
"message": "en"
}
}
3 changes: 3 additions & 0 deletions locale/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6122,5 +6122,8 @@
},
"adsbHeartbeatTotalMessages": {
"message": "Повід. сигналів перевірки"
},
"currentLanguage": {
"message": "uk"
}
}
3 changes: 3 additions & 0 deletions locale/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6156,5 +6156,8 @@
},
"adsbHeartbeatTotalMessages": {
"message": "心跳消息"
},
"currentLanguage": {
"message": "zh-CN"
}
}
6 changes: 5 additions & 1 deletion src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2332,4 +2332,8 @@ ol li {

.bold {
font-weight: bold;
}
}

*:lang(ja) {
font-family:"ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro",Osaka, "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", sans-serif;
}
Loading