Add locale-aware config and localized framework UI defaults#2054
Add locale-aware config and localized framework UI defaults#2054khashashin wants to merge 1 commit intoobservablehq:mainfrom
Conversation
|
Is it global, or is it possible to have a multilingual project? Where some articles would be in English and other in Arabic? |
|
@Fil yes, page-level overrides are supported, so you can have a multilingual project where different pages use different language/locale settings. This is handled via front matter support here: https://github.com/observablehq/framework/pull/2054/changes#diff-77b3519370ff48f6caf7c316f0ece966f2f0871c40e9381d451d2c5b1c76b40fR113 For example: ---
lang: ar
dir: rtl
locale: ar-EG
---So you can have one page in English and another in Arabic within the same project. One current limitation is that some config-derived defaults remain project-level unless explicitly overridden, such as the default |
This PR adds project- and page-level locale support to Framework and localizes Framework-owned UI defaults.
Changes:
locale,lang, anddirto Framework configlocale,lang, anddirlang/dirduring renderThis intentionally keeps translation catalogs and fallback policy out of Framework core; those remain user-land concerns.
This is the Framework-side companion to the Plot locale work, keeping translation catalogs and fallback logic out of Framework core.