Skip to main content

embedded_catalog

Macro embedded_catalog 

macro_rules! embedded_catalog {
    ($vis:vis static $name:ident, [$($locale:literal),+ $(,)?]) => { ... };
    ($vis:vis fn, [$($locale:literal),+ $(,)?]) => { ... };
}
Expand description

Define the calling crate’s EmbeddedCatalog: locales/en-US.ftl in the crate embedded as the source, the crate’s other locales/<locale>.ftl read from the language packs (LanguagePack, named by the crate’s package name), the user’s locale when no host chose one, and source copy pinned in the crate’s own tests.

embedded_catalog!(pub(crate) static STORE_CATALOG, ["en-US", "de-DE"]) defines just the static; embedded_catalog!(pub fn, ["en-US"]) defines CATALOG and the t / t_args lookups the crate’s copy goes through.