Open doowonee opened 1 year ago
Show me your file struct please
I use cargo workspace and i18n is in A crate in workspace.
I usually run B crate. When I modified en.toml
in A crate and run B it shows not changed. only after cargo clean
works
From my observations, if you modify only localization files in crate A, Cargo will not trigger a rebuild when crate B, which depends on A, is compiled. This results in B using an outdated version of A's localization files.
One solution I got hinted at in the Rust GameDev discord is to add locales
folder as a build dependency via buildscript in crate A. Like this:
build.rs
fn main() {
println!("cargo:rerun-if-changed=locales");
}
Note that this will rebuild the whole crate A
every time you change localization files.
Thank you for your investigation!
Does it can detect file changed and compile newer version of locale files? It seems not work.
I just modified the value with the same key locale file
en.toml
and it just showed me previous value of it.How to tell
rust-i18n
to file is changed?