Skip to content

fix(sidebar): Japanese/Korean font fallbacks and better ja translations - #1197

Merged
qwqcode merged 3 commits into
ArtalkJS:masterfrom
5ym:fix/ja-font-and-locale
Oct 11, 2026
Merged

qwqcode merged 3 commits into
ArtalkJS:masterfrom
5ym:fix/ja-font-and-locale

Conversation

@5ym

@5ym 5ym commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Recreated from #1183, which could not be reopened because I had deleted my fork. Same two commits, unchanged; they still merge cleanly into current master.

Problem

Fonts. The sidebar (message center / dashboard iframe) uses a font stack that lists only Chinese fonts before the generic fallback:

..., Helvetica, 'PingFang SC', 'Microsoft YaHei', ...

Latin fonts such as Segoe UI and Helvetica have no CJK glyphs, so on Windows/Linux Japanese text is rendered with Microsoft YaHei (Simplified Chinese). Japanese users see Chinese glyph shapes for kanji and kana that look "off". Korean has the same issue. (The comment widget itself is fine because it uses font-family: inherit.)

Translations. Some ja strings are literal translations that read awkwardly or are misleading. For example the message center tab "Mine" was 私の (a bare possessive, "my …"); a Japanese reader can't tell what it refers to.

Changes

  • ui/artalk-sidebar/src/style/_variables.scss, style.scss: add $font-family-ja / $font-family-ko stacks that prefer the platform's native fonts (Hiragino Sans / Yu Gothic / Meiryo / Noto Sans JP, Apple SD Gothic Neo / Malgun Gothic / Noto Sans KR) and apply them with :lang(ja) / :lang(ko). Other locales are untouched.
  • ui/artalk-sidebar/src/i18n.ts: setLocale() now sets document.documentElement.lang, so the :lang() selectors (and assistive technology) know the current language. index.html has no lang attribute today.
  • ui/artalk-sidebar/src/i18n/ja.ts, ui/artalk/src/i18n/ja.ts: wording fixes, e.g.
    • mine: 私の → 自分のコメント
    • ctrlCenter (sidebar): コントロールセンター → 管理画面 (matches the widget's "ダッシュボード" intent; en is "Admin")
    • noContent: コンテンツなし → データがありません
    • signIn / signUp: サインイン / サインアップ → ログイン / アカウント登録
    • email: Eメール → メールアドレス
    • listRetry: 再試行するにはクリック → 再試行
    • pendingMsg, waitSeconds, forgetPassword, cacheWarm, payload, … (see diff)

Verified with prettier --check using the repo config. No behavior change other than the lang attribute and the language-scoped font stacks.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EfBin5pdPhVGNJy5B2NkK2

5ym and others added 2 commits September 5, 2026 00:55
The sidebar font stack only lists Chinese fonts (PingFang SC, Microsoft
YaHei) before the generic fallback, so on Windows/Linux systems without a
matching UI font, Japanese and Korean text is rendered with Chinese glyph
shapes (e.g. Microsoft YaHei for Japanese).

Add dedicated stacks for ja and ko that prefer the platform's native fonts
(Hiragino / Yu Gothic / Meiryo / Noto Sans JP, Apple SD Gothic Neo / Malgun
Gothic / Noto Sans KR) and apply them with :lang(). setLocale() now sets
<html lang> so the selectors (and assistive tech) know the current language.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Several strings were literal translations that read awkwardly or were
misleading, e.g. "Mine" in the message center was "私の" (a bare
possessive); it now reads "自分のコメント" (my comments). Also align the
admin panel name between the widget and the sidebar, and use the wording
commonly seen in Japanese UIs (ログイン, メールアドレス, 再試行, ...).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@qwqcode
qwqcode merged commit 796ee2d into ArtalkJS:master Oct 11, 2026
7 checks passed
@qwqcode

qwqcode commented Oct 11, 2026

Copy link
Copy Markdown
Member

Thanks for recreating this and for your patience! I've reviewed the changes, including locale switching and the Japanese/Korean font stacks. Tests and builds passed, and I've squash-merged the PR with your authorship preserved. Thanks again for improving Artalk's Japanese translations and font support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants