Skip to content

Commit

Permalink
renamed translations-uri to translations-path
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptistemontan committed Jan 12, 2025
1 parent 15eaf10 commit c8c51c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/book/src/reduce_size/02_dynamic_load.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ Then if you are using Trunk you just have to add the directory to the build pipe
```

Now the translations will be available at `i18n/{locale}.json`
To inform `leptos_i18n` where to find those translations you need to supply the `translations-uri` field under `[package.metadata.leptos-i18n]`:
To inform `leptos_i18n` where to find those translations you need to supply the `translations-path` field under `[package.metadata.leptos-i18n]`:

```toml
# Cargo.toml
[package.metadata.leptos-i18n]
translations-uri = "i18n/{locale}.json" # or "i18n/{namespace}/{locale}.json" when using namespaces
translations-path = "i18n/{locale}.json" # or "i18n/{namespace}/{locale}.json" when using namespaces
```

And this is it!
Expand Down
2 changes: 1 addition & 1 deletion examples/dynamic_load/csr_counter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ console_error_panic_hook = { version = "0.1" }
[package.metadata.leptos-i18n]
default = "en"
locales = ["en", "fr"]
translations-uri = "i18n/{locale}.json"
translations-path = "i18n/{locale}.json"

[build-dependencies]
leptos_i18n_build = { path = "../../../leptos_i18n_build" }
Expand Down
2 changes: 1 addition & 1 deletion leptos_i18n_parser/src/parse_locales/cfg_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl Field {
pub const LOCALES: &'static str = "locales";
pub const NAMESPACES: &'static str = "namespaces";
pub const LOCALES_DIR: &'static str = "locales-dir";
pub const TRANSLATIONS_URI: &'static str = "translations-uri";
pub const TRANSLATIONS_URI: &'static str = "translations-path";
pub const FIELDS: &'static [&'static str] = &[
Self::DEFAULT,
Self::LOCALES,
Expand Down

0 comments on commit c8c51c0

Please sign in to comment.