static_loader!() { /* proc-macro */ }
Expand description
Loads all of your fluent resources at compile time as &'static str
s and
and creates a new StaticLoader
static variable that you can use in your
program. This allows you to easily ship your localisations as part of a
single binary.
ยงExample
fluent_templates::static_loader! {
// Declare our `StaticLoader` named `LOCALES`.
static LOCALES = {
// The directory of localisations and fluent resources.
locales: "./tests/locales",
// The language to falback on if something is not present.
fallback_language: "en-US",
// Optional: A shared fluent resource
core_locales: "./tests/locales/core.ftl",
// Optional: A function that is run over each fluent bundle.
customise: |bundle| {},
};
}