leptos-fluent icon indicating copy to clipboard operation
leptos-fluent copied to clipboard

Follow `static_loader!` definition

Open mondeja opened this issue 8 months ago • 2 comments

AFAIK, seems possible the reading of the source code to search for the location of the fluent-templates static_loader! macro definition and parse its content:

static_loader! {
    static TRANSLATIONS = {
        locales: "./locales",
        fallback_language: "en",
    };
}

Because we are passing TRANSLATIONS to leptos_fluent! macro, we can know where is defined. Even if is not inside the current file, altough that case could be a bit difficult.

This will allow to not need to duplicate the locales: "..." argument and the future argument core_locales: "..." (see #89).

mondeja avatar Jun 03 '24 00:06 mondeja