diff --git a/CHANGELOG.md b/CHANGELOG.md index c2e02d20..7120724d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## 2024-06-15 - [0.0.36] + +### Bug fixes + +- Fix error building files tracker when multiple files for each language. + ## 2024-06-15 - [0.0.35] ### Bug fixes @@ -192,6 +198,7 @@ - Added all ISO-639-1 and ISO-639-2 languages. +[0.0.36]: https://github.com/mondeja/leptos-fluent/compare/v0.0.35...v0.0.36 [0.0.35]: https://github.com/mondeja/leptos-fluent/compare/v0.0.34...v0.0.35 [0.0.34]: https://github.com/mondeja/leptos-fluent/compare/v0.0.33...v0.0.34 [0.0.33]: https://github.com/mondeja/leptos-fluent/compare/v0.0.32...v0.0.33 diff --git a/Cargo.lock b/Cargo.lock index 8dfe4158..6271bc58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1446,7 +1446,7 @@ dependencies = [ [[package]] name = "leptos-fluent" -version = "0.0.35" +version = "0.0.36" dependencies = [ "fluent-templates", "leptos", @@ -1478,7 +1478,7 @@ dependencies = [ [[package]] name = "leptos-fluent-macros" -version = "0.0.35" +version = "0.0.36" dependencies = [ "fluent-syntax", "fluent-templates", diff --git a/README.md b/README.md index e79b27d9..1474c3ba 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Add the following to your `Cargo.toml` file: ```toml [dependencies] -leptos-fluent = "0.0.35" +leptos-fluent = "0.0.36" fluent-templates = "0.9" [features] diff --git a/examples/ssr-hydrate-actix/locales/en/404.ftl b/examples/ssr-hydrate-actix/locales/en/404.ftl new file mode 100644 index 00000000..f12e18ea --- /dev/null +++ b/examples/ssr-hydrate-actix/locales/en/404.ftl @@ -0,0 +1 @@ +not-found = Not Found diff --git a/examples/ssr-hydrate-actix/locales/en/main.ftl b/examples/ssr-hydrate-actix/locales/en/main.ftl index 50c0f7cf..3aefd4cb 100644 --- a/examples/ssr-hydrate-actix/locales/en/main.ftl +++ b/examples/ssr-hydrate-actix/locales/en/main.ftl @@ -1,2 +1 @@ welcome-to-leptos = Welcome to Leptos! -not-found = Not Found diff --git a/examples/ssr-hydrate-actix/locales/es/404.ftl b/examples/ssr-hydrate-actix/locales/es/404.ftl new file mode 100644 index 00000000..f91c50d7 --- /dev/null +++ b/examples/ssr-hydrate-actix/locales/es/404.ftl @@ -0,0 +1 @@ +not-found = No encontrado diff --git a/examples/ssr-hydrate-actix/locales/es/main.ftl b/examples/ssr-hydrate-actix/locales/es/main.ftl index 835556e8..62c060b0 100644 --- a/examples/ssr-hydrate-actix/locales/es/main.ftl +++ b/examples/ssr-hydrate-actix/locales/es/main.ftl @@ -1,2 +1 @@ welcome-to-leptos = ¡Bienvenido a Leptos! -not-found = No encontrado diff --git a/leptos-fluent-macros/Cargo.toml b/leptos-fluent-macros/Cargo.toml index 8c2ba2f8..f0faa22a 100644 --- a/leptos-fluent-macros/Cargo.toml +++ b/leptos-fluent-macros/Cargo.toml @@ -2,7 +2,7 @@ name = "leptos-fluent-macros" description = "Macros for leptos-fluent" edition.workspace = true -version = "0.0.35" +version = "0.0.36" license = "MIT" documentation.workspace = true repository.workspace = true diff --git a/leptos-fluent-macros/src/files_tracker.rs b/leptos-fluent-macros/src/files_tracker.rs index 7a0e2235..1e166608 100644 --- a/leptos-fluent-macros/src/files_tracker.rs +++ b/leptos-fluent-macros/src/files_tracker.rs @@ -7,15 +7,14 @@ pub(crate) fn build_files_tracker_quote( ) -> proc_macro2::TokenStream { let mut files_tracker_str = "{".to_string(); for (lang, paths) in fluent_resources.iter() { - files_tracker_str - .push_str(&format!("let {} = vec![", lang.replace('-', "_"))); - for path in paths { + for (i, path) in paths.iter().enumerate() { files_tracker_str.push_str(&format!( - "include_bytes!(\"{}\"),", + "let {}{} = include_bytes!(\"{}\");", + lang.replace('-', "_"), + i, &escape_string(path) )); } - files_tracker_str.push_str("];"); } if let Some(languages_file_path) = &languages_path { files_tracker_str.push_str(&format!( diff --git a/leptos-fluent/Cargo.toml b/leptos-fluent/Cargo.toml index 6584402b..0f57d973 100644 --- a/leptos-fluent/Cargo.toml +++ b/leptos-fluent/Cargo.toml @@ -2,7 +2,7 @@ name = "leptos-fluent" description = "Fluent framework for internationalization of Leptos applications" edition.workspace = true -version = "0.0.35" +version = "0.0.36" license = "MIT" documentation.workspace = true repository.workspace = true diff --git a/leptos-fluent/README.md b/leptos-fluent/README.md index e79b27d9..1474c3ba 100644 --- a/leptos-fluent/README.md +++ b/leptos-fluent/README.md @@ -19,7 +19,7 @@ Add the following to your `Cargo.toml` file: ```toml [dependencies] -leptos-fluent = "0.0.35" +leptos-fluent = "0.0.36" fluent-templates = "0.9" [features] diff --git a/leptos-fluent/src/lib.rs b/leptos-fluent/src/lib.rs index b4d13763..ce3a81cf 100644 --- a/leptos-fluent/src/lib.rs +++ b/leptos-fluent/src/lib.rs @@ -14,7 +14,7 @@ //! //! ```toml //! [dependencies] -//! leptos-fluent = "0.0.35" +//! leptos-fluent = "0.0.36" //! fluent-templates = "0.9" //! //! [features]