Agent Wranglers

LOC-10Optional

Support vertical and CJK text

Where Chinese, Japanese or Korean (CJK) text appears, support vertical writing and their line breaking with writing-mode and the right line-break rules.

How to do it

Use writing-mode, line-break and word-break: auto-phrase where the language needs them. auto-phrase works only for Japanese and Korean, and only in Chromium browsers. Others fall back to normal breaking. For Arabic and Hebrew, see Support right-to-left text.

Examples

CSS example

:lang(ja) { line-break: strict; word-break: auto-phrase; }
.vertical:lang(ja) { writing-mode: vertical-rl; }

How to check

Text in the CJK pages breaks between phrases, and vertical blocks read top to bottom, right to left.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/localization/layout-and-scripts/writing-modes">Agent Wranglers localization playbook</a>. In code you write, add a comment next to it with the same link.