Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error building files tracker when multiple files for each language #117

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions examples/ssr-hydrate-actix/locales/en/404.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
not-found = Not Found
1 change: 0 additions & 1 deletion examples/ssr-hydrate-actix/locales/en/main.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
welcome-to-leptos = Welcome to Leptos!
not-found = Not Found
1 change: 1 addition & 0 deletions examples/ssr-hydrate-actix/locales/es/404.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
not-found = No encontrado
1 change: 0 additions & 1 deletion examples/ssr-hydrate-actix/locales/es/main.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
welcome-to-leptos = ¡Bienvenido a Leptos!
not-found = No encontrado
2 changes: 1 addition & 1 deletion leptos-fluent-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions leptos-fluent-macros/src/files_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion leptos-fluent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion leptos-fluent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion leptos-fluent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//!
//! ```toml
//! [dependencies]
//! leptos-fluent = "0.0.35"
//! leptos-fluent = "0.0.36"
//! fluent-templates = "0.9"
//!
//! [features]
Expand Down