mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-11 16:30:12 -06:00
M7: localization layer (#128)
UI strings come from per-language TOML catalogs compiled in (English text as the key and fallback, named placeholders, one/other plurals, context suffixes); command labels are translated at display time while ids, CLI, MCP and control output stay English; accessibility names follow. Preferences > Language (System / English / Español, live; the system language from the OS or the browser), pref.language for scripts. A key check test guards the catalogs. The Spanish catalog is a machine draft awaiting native review; docs/translating.md explains adding a language.
This commit is contained in:
@@ -86,4 +86,8 @@ impl Services for WebServices {
|
||||
fn reduce_motion(&self) -> bool {
|
||||
self.reduce_motion.as_ref().is_some_and(web_sys::MediaQueryList::matches)
|
||||
}
|
||||
/// The browser's language (`navigator.language`).
|
||||
fn system_language(&self) -> Option<String> {
|
||||
web_sys::window().and_then(|w| w.navigator().language())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user