Skip to content

Commit

Permalink
Search translation resources recursively in workdir
Browse files Browse the repository at this point in the history
This is to support use cases like a crate using rust-i18n is being used
by another crate.

This only solves some use cases though (e.g. when the crate being used
is included via a subdir or git submodule), it may no work when the
crate being used is included by crago.
  • Loading branch information
eyeplum committed Dec 6, 2021
1 parent 276ca32 commit 96c24aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target
Cargo.lock
debug.txt
debug.txt
.idea/
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn load_locales() -> Translations {
let dest = std::env::var("OUT_DIR").expect("OUT_DIR env not found");
let workdir = rust_i18n_support::workdir(&dest);
println!("cargo:i18n-workdir={}", &workdir);
let locale_path = format!("{}/locales/**/*.yml", workdir);
let locale_path = format!("{}/**/locales/**/*.yml", workdir);
println!("cargo:i18n-locale-path={}", &locale_path);

for entry in glob(&locale_path).expect("Failed to read glob pattern") {
Expand Down

0 comments on commit 96c24aa

Please sign in to comment.