[][src]Macro fluent_template_macros::static_loader

static_loader!() { /* proc-macro */ }

Loads all of your fluent resources at compile time as &'static strs 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| {},
    };
}