summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortomasz1986 <twilczynski@naver.com>2022-02-08 07:07:22 +0100
committerGitHub <noreply@github.com>2022-02-08 07:07:22 +0100
commitc396124bc9fa6ae162f9634869e16a694c8d2525 (patch)
tree2336de30a53c6f20154c70b7d0902ff2f8e49b42
parentd35d7d23600b2ea2478924e297a70cac64ef62ea (diff)
gui: Don't use italic text for CJK languages (#8172)
Even though technically possible, CJK languages normally don't use italic text at all, as not only does it make the characters/letters look unnatural, but also, in the case of complex characters, unreadable too. For these reasons, it is usually recommended not to use the italic font style at all [1][2]. This commit changes the default font-style of the i element for Chinese, Japanese, and Korean langauge to "normal" instead of "italic". In order to do so, the HTML lang attribute is also changed following each change of the GUI language. [1] https://bobtung.medium.com/best-practice-in-chinese-layout-f933aff1728f [2] https://devblogs.microsoft.com/oldnewthing/20060914-02/?p=29743 Signed-off-by: Tomasz WilczyƄski <twilczynski@naver.com>
-rw-r--r--gui/default/assets/css/overrides.css7
-rw-r--r--gui/default/syncthing/core/localeService.js1
2 files changed, 8 insertions, 0 deletions
diff --git a/gui/default/assets/css/overrides.css b/gui/default/assets/css/overrides.css
index 410e597339..b2d93950a4 100644
--- a/gui/default/assets/css/overrides.css
+++ b/gui/default/assets/css/overrides.css
@@ -506,3 +506,10 @@ ul.three-columns li, ul.two-columns li {
padding-top: 6px;
padding-bottom: 6px;
}
+
+/* CJK languages don't use italic at all, hence don't force it on them. */
+html[lang|="zh"] i,
+html[lang="ja"] i,
+html[lang|="ko"] i {
+ font-style: normal;
+}
diff --git a/gui/default/syncthing/core/localeService.js b/gui/default/syncthing/core/localeService.js
index 868f400a3e..8486df7688 100644
--- a/gui/default/syncthing/core/localeService.js
+++ b/gui/default/syncthing/core/localeService.js
@@ -99,6 +99,7 @@ angular.module('syncthing.core')
function useLocale(language, save2Storage) {
if (language) {
$translate.use(language).then(function () {
+ document.documentElement.setAttribute("lang", language);
if (save2Storage && _localStorage)
_localStorage[_SYNLANG] = language;
});