XAMPPRocky/fluent-templates

Static Loader doesn't notice new files when rebuilding

Open

#2 创建于 2020年6月10日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)Rust (38 fork)auto 404
buggood first issuehelp wanted

仓库指标

Star
 (167 star)
PR 合并指标
 (PR 指标待抓取)

描述

When I use include_str or similar macros, if I change the referenced file and rebuild, cargo notices the change and rebuilds the source file.

Unfortunately, in my initial testing, I can't seem to get the static_loader! to reload new content without changing some other source file. Is there a way to get the static_loader! macro to notify Cargo that it's depending on those files and to rebuild if they change?

The way I'm testing is I have this snippet:

fluent_templates::static_loader! {
    // Declare our `StaticLoader` named `LOCALES`.
    pub static LOCALES = {
        // The directory of localisations and fluent resources.
        locales: "./shared/src/strings",
        // The language to fallback on if something is not present.
        fallback_language: "en-US",
    };
}

And I load it and render a string out from the referenced LOCALES, and if I run the program once, change the string, cargo run again I don't see the new value. If I cargo clean I do.

Thank you for the great library; it is very easy to use.

贡献者指南