2024-09-25 - 0.1.23
- Allow single braces syntax for
leptos_fluent!
macro. The current syntaxleptos_fluent! {{ ... }}
is still supported but now triggers a deprecation warning. It will not be supported fromv0.2
. Useleptos_fluent! { ... }
instead.
2024-09-24 - 0.1.22
- Fix translations checker not detecting translation macros inside macro calls (regression from v0.1.21).
2024-08-27 - 0.1.21
- Fix translation macros not extracted from some locations when a variable binding is not used in translations checker.
2024-08-26 - 0.1.20
- Fix variables in Fluent selectors not being extracted as placeables when checking translations.
2024-08-19 - 0.1.19
- Allow to pass
i18n
as first argument totr!
andmove_tr!
macros. This is an alternative to panicking when using the macros in event handlers.
2024-08-18 - 0.1.18
- Relax
fluent-templates
dependency.
2024-08-17 - 0.1.17
- Add
set_language_from_navigator
parameter toleptos_fluent!
macro to set the language at runtime from the browser language.
2024-08-16 - 0.1.16
- Add
debug
feature to print debug information when usingleptos_fluent!
macro. - Some performance improvements.
2024-08-15 - 0.1.15
- Fix syntax error produced at
leptos_fluent!
macro expansion when usingsync_html_tag_dir
but notsync_html_tag_lang
or vice versa on SSR (regression from v0.1.14).
2024-08-14 - 0.1.14
- Deprecate
SsrHtmlTag
component. Thesync_html_tag_lang
andsync_html_tag_dir
parameters ofleptos_fluent!
macro are enough to sync the<html>
tag attributes with the current language and direction on SSR. Will be removed on v0.2.
2024-08-11 - 0.1.13
- Fix bug discovering initial language from
navigator.languages
(regression from v0.1.11).
2024-08-05 - 0.1.12
- Add
initial_language_from_url_path
parameter toleptos_fluent!
macro to set the initial language from URL path. - Add
initial_language_from_url_path_to_cookie
toleptos_fluent!
macro to set the initial language from URL path to a cookie. - Add
initial_language_from_url_path_to_localstorage
toleptos_fluent!
macro to set the initial language from URL path to local storage. - Add
initial_language_from_url_path_to_server_function
toleptos_fluent!
macro to set the initial language from URL path to a server function.
2024-08-04 - 0.1.11
- Fix translations checker not extracting Fluent function positional arguments as placeables.
-
Accept multiple configuration conditional checks for the same parameters in
leptos_fluent!
macro:leptos_fluent! { // ... #[cfg(debug_assertions)] set_language_to_url_param: true, #[cfg(not(debug_assertions))] set_language_to_url_param: false, }
2024-08-03 - 0.1.10
-
Accept almost all possible constant compile-time config expression paths for some
leptos_fluent!
parameters likelanguages
.For example, only use a languages file when compiling on Unix systems:
leptos_fluent! { // ... #[cfg(target_family = "unix")] languages: "./locales/languages.json", }
2024-08-02 - 0.1.9
- Allow struct field init shorthand for
leptos_fluent!
expressions macro parameters.
2024-07-01 - 0.1.8
- Add
tracing
feature to enable building withtracing
support.
- Stop depending on
wasm-bindgen
fromleptos-fluent
crate. - Better error messages parsing parameters with
leptos_fluent!
macro.
2024-06-29 - 0.1.7
- Add next parameters to
leptos_fluent!
macro:initial_language_from_server_function
to set the initial language from a server function.set_language_to_server_function
set language updates to a server function.initial_language_from_localstorage_to_server_function
to set the initial language from local storage to a server function.initial_language_from_cookie_to_server_function
to set the initial language from a cookie to a server function.initial_language_from_navigator_to_server_function
to set the initial language from the browser language to a server function.initial_language_from_url_param_to_server_function
to set the initial language from URL parameter to a server function.initial_language_from_server_function_to_cookie
to set the initial language from a server function to a cookie.initial_language_from_server_function_to_localstorage
to set the initial language from a server function to local storage.
- Accept
#[cfg(debug_assertions)]
and#[cfg(not(debug_assertions))]
conditional checks for the nextleptos_fluent!
macro parameters:check_translations
languages
core_locales
2024-06-27 - 0.1.6
- Add
provide_meta_context
parameter toleptos_fluent!
to provide meta information about the macro caller arguments. Use, for example,leptos_fluent::i18n().meta().unwrap().cookie_name
to get the valuecookie_name
used as parameter for the macro. - Add
flag
field toleptos_fluent::Language
storing emoji flag automatic discovered for each language identifier with a country code.
-
Accept configuration conditional checks directly in most macro parameters:
leptos_fluent! { // ... #[cfg(debug_assertions)] initial_language_from_url_param: true, #[cfg(debug_assertions)] set_language_to_url_param: true, }
2024-06-26 - 0.1.5
- Add
leptos_fluent::SsrHtmlTag
component to render it on SSR to sync global attributes of<html>
tag with the current language. - Add new feature
system
to enable functionalities that require system information. Useful on non wasm targets like desktop applications. See GTK example. - Add
initial_language_from_system
parameter toleptos_fluent!
macro to set the initial language from the system language. Useful for desktop applications. Must be enabled the new featuresystem
to use it. - Add
initial_language_from_data_file
parameter toleptos_fluent!
macro to set the initial language from a data file when usingsystem
feature. - Add
set_language_to_data_file
parameter toleptos_fluent!
macro to set the current language to a data file when usingsystem
feature. - Add
data_file_key
parameter toleptos_fluent!
macro to specify the file key to store the current language when usingsystem
feature. - Add
initial_language_from_system_to_data_file
parameter toleptos_fluent!
macro to set the initial language from the system language to a data file when usingsystem
feature.
- Use files tracker API instead of
include_bytes!
quirk to track files whennightly
feature is enabled.
2024-06-25 - 0.1.4
- Add
initial_language_from_navigator_to_localstorage
parameter toleptos_fluent!
macro to set the initial language from the browser language to local storage. - Add
initial_language_from_navigator_to_cookie
parameter toleptos_fluent!
macro to set the initial language from the browser language to a cookie.
2024-06-24 - 0.1.3
- Add
initial_language_from_localstorage_to_cookie
parameter toleptos_fluent!
macro to set the initial language from local storage to a cookie. - Allow to call
leptos_fluent::I18n
context to get and set the current active language withi18n()
to get andi18n(lang)
to set when the featurenightly
is enabled.
2024-06-22 - 0.1.2
- Add
initial_language_from_url_param_to_cookie
parameter toleptos_fluent!
macro to set the initial language from URL parameter to a cookie. - Add
initial_language_from_cookie_to_localstorage
parameter toleptos_fluent!
macro to set the initial language from a cookie to local storage. - Add
nightly
feature to enable functionalities that require a nightly toolchain.
- Validate cookie attributes in
leptos_fluent!
when defined using string literals. - Show locations of
tr!
macros with translations checker when using thenightly
feature.
2024-06-21 - 0.1.1
- Add method
activate
toleptos_fluent::Language
struct to set a language active. Uselang.activate()
instead ofexpect_i18n().language.set(lang)
.
2024-06-20 - 0.1.0
- The parameter
translations
of theleptos_fluent!
macro must now be an array of translations. Replacetranslations: TRANSLATIONS
bytranslations: [TRANSLATIONS]
.
- Add
sync_html_tag_dir
parameter toleptos_fluent!
macro to sync thedir
global attribute of the<html>
tag with the current language direction. - Multiple translations can be passed to the
leptos_fluent!
macro.
leptos-fluent will include breaking changes in minor versions during
the v0.x.0 series until v1.0.0 version is reached. Is safe to pin the
version to 0.1
during installation.
2024-06-16 - 0.0.37
- Don't panic parsing raw string literals of
tr!
macros checking translations.
- Notify invalid Fluent message identifiers checking translations.
- Add
cookie_attrs
parameter toleptos_fluent!
macro to set cookie attributes.
2024-06-15 - 0.0.36
- Fix error building files tracker when multiple files for each language.
2024-06-15 - 0.0.35
- Get the initial language from URL parameter on server side rendering.
2024-06-09 - 0.0.34
- Allow to read languages from a JSON5 file with a new feature
json5
. - Add
core_locales
argument toleptos_fluent!
macro to specify the file where the core locales are located.
- Improved error messages when reading languages from files.
2024-06-04 - 0.0.33
- Fluent syntax errors found checking translations are now reported instead of panicking.
2024-06-03 - 0.0.32
locales
argument ofleptos_fluent!
macro is now required.
- Fix a lot of bugs checking translations.
- Glob passed to
check_translations
argument ofleptos_fluent!
macro accepts brace expansion. - Locale and language files are now tracked.
2024-06-03 - 0.0.31
- Fix error setting cookies.
2024-06-03 - 0.0.30
- Fix trait not in scope error when using
tr!
andmove_tr!
macros.
2024-06-03 - 0.0.29
- Replace
I18n.is_active_language(lang)
method byLanguage.is_active()
. Use<input ... checked=lang.is_active() ... />
instead of<input ... checked=i18n.is_active_language(lang) ... />
. - Removed
I18n.default_language()
method. Usei18n.languages[0]
. - Removed
I18n.tr()
andI18n.trs()
methods. Use thetr!
macro. tr!
andmove_tr!
macros only accepts literal strings as the message name (first argument) and in the keys of translation arguments.
- Add
check_translations
argument toleptos_fluent!
macro to check translations at compile time.
2024-06-01 - 0.0.28
- Add
cookie_name
,initial_language_from_cookie
andset_language_to_cookie
parameters toleptos_fluent!
macro.
2024-05-31 - 0.0.27
- Add
yaml
feature to read languages from a YAML file. - Add
json
feature to read languages from a JSON file (enabled by default).
- The method
I18n.set_language
has been removed. Usei18n.language.set(lang)
instead ofi18n.set_language(lang)
. - The method
I18n.language_key
has been removed. Use<For ... key=move |lang| *lang ... />
instead of<For ... key=move |lang| i18n.language_key(lang) ... />
. - The method
I18n.language_from_str
has been removed. UseLanguage::from_str
instead ofI18n.language_from_str
.
- Add
impl Hash
forLanguage
struct. - Add
impl IntoAttribute
forLanguage
struct. Use<input ... id=lang />
instead of<input ... id=lang.id.to_string() />
.
2024-05-28 - 0.0.26
- Rename
initial_language_from_url
parameter ofleptos_fluent!
macro asinitial_language_from_url_param
. - Rename
initial_language_from_url_param
parameter ofleptos_fluent!
macro asurl_param
. - Rename
initial_language_from_url_to_localstorage
parameter ofleptos_fluent!
macro asinitial_language_from_url_param_to_localstorage
.
- Add
set_language_to_url_param
macro parameter toleptos_fluent!
macro.
- Drop
leptos_router
as a dependency.
2024-05-27 - 0.0.25
- Rename
set_to_localstorage
parameter ofleptos_fluent!
macro asset_language_to_localstorage
.
2024-05-20 - 0.0.24
- Add
I18n.is_active_language
method. - Add
I18n.language_key
method to return a hash for the current language with their active status for usage inFor
components. - Add
set_to_localstorage
parameter toleptos_fluent!
macro. - Add
use_i18n
andexpect_i18n
function.
- Replace
I18n.set_language_with_localstorage
method withI18n.set_language
. Useset_to_localstorage
macro parameter andI18n.set_language
method instead. - Remove
csr
feature.
- Fix errors getting initial language from URL parameter and local storage.
2024-05-18 - 0.0.23
- Add
axum
feature to integrate with Axum web framework.
2024-05-01 - 0.0.22
- Fix error about required translation tree files in main example of documentation.
2024-03-23 - 0.0.21
- Minimum Leptos version set to
0.6
. - Fix hydration mode.
- Allow to get the initial language on SSR from the
Accept-Language
header. - Added
actix
feature to integrate with Actix Web framework.
2024-03-10 - 0.0.20
- One of the features
csr
,hydrate
orssr
must be enabled.
- Add SSR support.
- Add hydration support.
- Added features
csr
,hydrate
andssr
.
I18n
context is nowCopy
able.- Crates now offers READMEs.
2024-03-07 - 0.0.17
- Don't require to install
unic_langid
. - Needs
fluent-templates
>= v0.9.0. - Constricted ranges of dependencies.
- Fixed errors in documentation.
- Added
kab
andcpp
dialects.
2024-03-02 - 0.0.15
- Added all ISO-639-1 and ISO-639-2 languages.