mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-25 10:46:50 -06:00
IDML names some languages by locale code (AppliedLanguage="$ID/de_DE_2006", "$ID/nl_NL_2005") beside names such as "English: USA" and "Spanish: Castilian". language_tag maps any locale code (ll, ll_CC, ll-CC, with a reform year after them) to its BCP 47 tag (de-DE, nl-NL; kept once per process, at most 512 distinct tags), ignores IDML's $ID/ prefix, and knows Spanish: Castilian (es-ES) and Swiss French and Italian. The stored name stays as written, so IDML round trips are unchanged. What depends on the language now goes by the tag: typographer's quotes (by language subtag; Swiss regions take guillemets), English hyphenation and spelling (is_english), Korean word breaking and the CJK fallback chains (ja-JP, ko-KR are Japanese and Korean whatever the region).