From e3054477134cee3d4cc133f68ea9f114e8980346 Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Wed, 28 Oct 2026 15:13:52 +0400 Subject: [PATCH] style(ja): CJK label rules for Japanese MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cjk.css now covers Japanese as well as Chinese: tight tracking, the 9px floor on dock voice labels and layer buttons, whole travel-mode and preset labels, catalog-case units in the HUD and the taller Recent Imagery cards. Japanese also gets strict line breaking (no line starts with ー or a small kana) and unbroken segment labels (すべて, 平面). Chinese rendering is unchanged: :is(:lang(zh), :lang(ja)) keeps the :lang(zh) specificity. Co-Authored-By: Claude Opus 5.5 --- src/ui/styles/cjk.css | 45 ++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/src/ui/styles/cjk.css b/src/ui/styles/cjk.css index 3c01d3987..d9cb9246d 100644 --- a/src/ui/styles/cjk.css +++ b/src/ui/styles/cjk.css @@ -1,6 +1,7 @@ -/* Tight tracking keeps Chinese labels readable; preserve Latin tracking for - intel HUD readouts and content marked translate="no", including its containers. */ -html:lang(zh) +/* Chinese and Japanese text. Tight tracking keeps CJK labels readable; + preserve Latin tracking for intel HUD readouts and content marked + translate="no", including its containers. */ +html:is(:lang(zh), :lang(ja)) body :not( #intel-hud, @@ -12,40 +13,52 @@ html:lang(zh) letter-spacing: 0.02em !important; } -/* Keep small Chinese labels legible at a minimum of 9px. */ -html:lang(zh) #command-dock .gev-mic-label, -html:lang(zh) #command-dock #gev-voice-detail, -html:lang(zh) .gev-voice-tier-btn, -html:lang(zh) .panel-layer-toggle { +/* Japanese line breaking: never start a line with ー, a small kana or closing + punctuation (プレビュ / ー). */ +html:lang(ja) body { + line-break: strict; +} + +/* Keep small CJK labels legible at a minimum of 9px. */ +html:is(:lang(zh), :lang(ja)) #command-dock .gev-mic-label, +html:is(:lang(zh), :lang(ja)) #command-dock #gev-voice-detail, +html:is(:lang(zh), :lang(ja)) .gev-voice-tier-btn, +html:is(:lang(zh), :lang(ja)) .panel-layer-toggle { font-size: 9px; } /* A two-glyph button label must not break between its glyphs. */ -html:lang(zh) .pp-mode-btn { +html:is(:lang(zh), :lang(ja)) .pp-mode-btn { + white-space: nowrap; +} + +/* Japanese segment labels are short words (すべて, 平面): keep each whole. */ +html:lang(ja) .gev-segment { white-space: nowrap; } /* Keep unit symbols in their catalog case, including the cockpit readouts. */ -html:lang(zh) #intel-hud *, -html:lang(zh) #cockpit-hud * { +html:is(:lang(zh), :lang(ja)) #intel-hud *, +html:is(:lang(zh), :lang(ja)) #cockpit-hud * { text-transform: none; } -/* Move short travel modes (步行 / 骑行) to the next line as whole words. */ -html:lang(zh) [data-layer-id='directions'] .data-toggle-meta { +/* Move short travel modes (步行 / 骑行, 徒歩 / 自転車) to the next line as + whole words. */ +html:is(:lang(zh), :lang(ja)) [data-layer-id='directions'] .data-toggle-meta { word-break: keep-all; overflow-wrap: break-word; } /* Leave room for the complete sensor name and resolution on two lines. */ -html:lang(zh) .recent-imagery-readout .ri-strip { +html:is(:lang(zh), :lang(ja)) .recent-imagery-readout .ri-strip { height: 131px; } -html:lang(zh) .recent-imagery-readout .ri-card { +html:is(:lang(zh), :lang(ja)) .recent-imagery-readout .ri-card { height: 123px; grid-template-rows: 42px 13px 22px 11px 18px; } -html:lang(zh) .recent-imagery-readout .ri-card-sensor { +html:is(:lang(zh), :lang(ja)) .recent-imagery-readout .ri-card-sensor { white-space: normal; text-overflow: clip; }