Localization
Locale descriptors, direction hints, translation extraction, and plural catalog output.
Quire localization is declarative. Source files compile to block descriptors and can be scanned into stable message catalogs without executing source.
Locale and direction
View-level locale and dir descriptors record localization intent. Direction is constrained to ltr, rtl, or auto.
From examples/site/docs.quire:
route "/docs"
locale locale("en-US", "ltr")
dir dir("ltr")
title page.metaTitle
seo seo(page.metaTitle, page.seoDescription, page.canonical, page.heroImage.url)
The localization helpers documented in the source are:
i18n(key, fallback?, locale?)for translation string descriptors.plural(key, count, one, other, locale?)for CLDR-cardinal plural descriptors.locale(tag, dir?)for locale descriptors.dir(value)for standalone view-level direction hints.
Extraction
Message extraction is a CLI and SDK operation. The source command is:
quire extract views/product.quire --locale en-US --out messages.json
Catalog output has format: "quire.message-catalog", version: 1, source file metadata, locale and direction fields, sorted message entries, and source locations for review workflows.
The playground source also exposes message extraction in the browser through extractMessageCatalog, but it still works from parsed and checked Quire source, not executed source.
Error handling
Invalid locale or direction descriptors are reported with diagnostic P0373. Invalid plural descriptors are reported with P0374.