use fission::prelude::*;
// Inside a Compose view: key, literal data, and library fallback differ.
Column(children: [
Text(TextContent::Key("settings.title".into())),
Text(TextContent::Literal(app_version.clone())),
Text(TextContent::KeyWithFallback {
key: "menu.copy".into(),
fallback: "Copy".into(),
}),
])
Choice | Type | Meaning | Notes / default behavior |
|---|---|---|---|
Literal(String) | TextContent | Render this exact string. | Good for dynamic values, ids, or already-translated text. |
Key(String) | TextContent | Look up the string through the current locale in Env.i18n. | Missing keys render as MISSING:key in the checked-in implementation. |
KeyWithFallback { key, fallback } | TextContent | Look up a translation key, falling back to a supplied string when no translation exists. | Use for framework-provided UI such as default context menu labels where a missing app bundle should not render MISSING:key. |