Skip to content

Commit

Permalink
Sort detected languages in locales folder by language name (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Feb 15, 2024
1 parent 14b21ec commit 8d9ba49
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
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 = "2021"
version = "0.0.13"
version = "0.0.14"
license = "MIT"
documentation = "https://docs.rs/leptos-fluent"
repository = "https://github.com/mondeja/leptos-fluent"
Expand Down
1 change: 1 addition & 0 deletions leptos-fluent-macros/src/languages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub(crate) fn read_locales_folder(path: &PathBuf) -> Vec<(String, String)> {
);
locales.push((lang_code, lang_name.to_string()));
}
locales.sort_by(|a, b| a.1.cmp(&b.1));
locales
}

Expand Down
2 changes: 1 addition & 1 deletion leptos-fluent-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl Parse for I18nLoader {
/// translations for each language in the application. This path should be
/// relative to your crate's `Cargo.toml`. Either `locales` or `languages` is
/// required.
/// - **`languages`**: ^ath to a languages file, which should be a JSON
/// - **`languages`**: Path to a languages file, which should be a JSON
/// array of arrays, where each inner array contains the language identifier and
/// the language name, respectively. The language identifier should be a valid
/// language tag, such as `en-US`, `es-ES`, `en`, `es`, etc. This path should be
Expand Down
4 changes: 2 additions & 2 deletions leptos-fluent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
name = "leptos-fluent"
description = "Fluent framework for internationalization of Leptos applications"
edition = "2021"
version = "0.0.13"
version = "0.0.14"
license = "MIT"
documentation = "https://docs.rs/leptos-fluent"
repository = "https://github.com/mondeja/leptos-fluent"

[dependencies]
leptos-fluent-macros = "0.0.13"
leptos-fluent-macros = "0.0.14"
fluent-templates = "0"
leptos = ">=0.1"
leptos_router = ">=0.1"
Expand Down

0 comments on commit 8d9ba49

Please sign in to comment.