|
1 | 1 | # CHANGELOG |
2 | 2 |
|
3 | | -## Unreleased |
| 3 | +## 2025-12-25 - [0.3.0] |
| 4 | + |
| 5 | +### Breaking changes |
| 6 | + |
| 7 | +#### Removed functions to simplify API |
| 8 | + |
| 9 | +The next deprecated functions and methods have been removed: |
| 10 | + |
| 11 | +- `i18n` (use `expect_context::<leptos_fluent::I18n>()` instead) |
| 12 | +- `use_i18n` (use `use_context::<leptos_fluent::I18n>()` instead) |
| 13 | +- `expect_i18n` (use `expect_context::<leptos_fluent::I18n>()` instead) |
| 14 | +- `Language.is_active` (use `i18n.language.get() == lang` instead) |
| 15 | +- `Language.activate` (use `i18n.language.set(lang)` instead) |
| 16 | +- `tr_impl` (use `i18n.tr(id)` method instead) |
| 17 | +- `tr_with_args_impl` (use `i18n.tr_with_args(id, args)` method instead) |
| 18 | + |
| 19 | +#### Removed options including `localstorage` and `sessionstorage` |
| 20 | + |
| 21 | +The deprecated options variants including the terms `localstorage` and |
| 22 | +`sessionstorage` in their names have been removed. Use the new variants |
| 23 | +including `local_storage` and `session_storage`. |
| 24 | + |
| 25 | +#### `Language.id` is now a `&'static str` |
| 26 | + |
| 27 | +The type of the `id` field of the `Language` struct has been changed |
| 28 | +from `unic_langid::LanguageIdentifier` to `&'static str`. This simplifies |
| 29 | +the usage of the `Language` struct and avoids unnecessary conversions. |
| 30 | + |
| 31 | +#### `*_translations` options are executed on all targets |
| 32 | + |
| 33 | +The options `check_translations` and `fill_translations` of `leptos_fluent!` |
| 34 | +were executed only on non-SSR targets by default. Now they are executed |
| 35 | +on all targets, so you need to disable them for SSR builds to prevent |
| 36 | +showing the same errors both in server and client builds. |
| 37 | + |
| 38 | +Use the `#[cfg(not(feature = "ssr"))]` attribute to disable them for SSR builds: |
| 39 | + |
| 40 | +```rust |
| 41 | +leptos_fluent! { |
| 42 | + #[cfg(not(feature = "ssr"))] |
| 43 | + check_translations: true, |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +#### Removed features `hydrate` and `disable-unicode-isolating-marks` |
| 48 | + |
| 49 | +The features `hydrate` and `disable-unicode-isolating-marks` have been |
| 50 | +removed and will throw an error if used. |
| 51 | + |
| 52 | +#### Changed type of `Language.id` field |
| 53 | + |
| 54 | +The type of the `id` field of the `Language` struct has been changed |
| 55 | +from `pub id: &'static fluent_templates::LanguageIdentifier`, to |
| 56 | +`pub id: &'static str`. |
| 57 | + |
| 58 | +Use `fluent_templates::LanguageIdentifier::from_str(language.id)` |
| 59 | +to convert it back. |
| 60 | + |
| 61 | +### New features |
| 62 | + |
| 63 | +#### Language entries with script subtags |
| 64 | + |
| 65 | +Add support for language entries with script subtags, automatically detecting |
| 66 | +script, flag and display name when using `sr-Latn`, `sr-Cyrl`, `zh-Hans`, |
| 67 | +`zh-Hant`, and similar BCP 47 tags. |
| 68 | + |
| 69 | +Includes the addition of an `Option<&'static str>` `script` field to `Language`. |
| 70 | + |
| 71 | +### Bug fixes |
| 72 | + |
| 73 | +- The URL does not set the language on hydration when using `initial_language_from_url_param`. |
4 | 74 |
|
5 | 75 | ## 2025-12-12 - [0.2.21] |
6 | 76 |
|
@@ -924,6 +994,7 @@ version to `0.1` during installation. |
924 | 994 |
|
925 | 995 | - Added all ISO-639-1 and ISO-639-2 languages. |
926 | 996 |
|
| 997 | +[0.3.0]: https://github.com/mondeja/leptos-fluent/compare/v0.2.21...v0.3.0 |
927 | 998 | [0.2.21]: https://github.com/mondeja/leptos-fluent/compare/v0.2.20...v0.2.21 |
928 | 999 | [0.2.20]: https://github.com/mondeja/leptos-fluent/compare/v0.2.19...v0.2.20 |
929 | 1000 | [0.2.19]: https://github.com/mondeja/leptos-fluent/compare/v0.2.18...v0.2.19 |
|
0 commit comments