pub fn lookup_static<'a, B: BundleCollection + ?Sized, C: CacheStore + ?Sized>(
bundles: &'a B,
cache: &C,
key: &'a str,
) -> Cow<'a, str>Expand description
Retrieves a localized message without arguments.
This function attempts to return a Cow::Borrowed referencing static binary data
whenever possible to avoid allocation.
§Resolution Order
- Current Language: Checks if the key exists in the current language.
- Fallback Language: If missing, checks the
FALLBACK_LANG_KEY(en-US). - Missing Key: Returns the
keyitself wrapped inCow::Borrowed.
§Arguments
bundles- The collection of Fluent bundles (usuallycrate::LOCALES).cache- The static cache map (usuallycrate::CACHE).key- The message ID to look up.