slint
slint copied to clipboard
Add support for translations on Windows
Support for translations via gettext is currently not supported on Windows.
This is due to a couple of issues:
- We have
#[cfg(...)]in place on our end to disablegettext-rs. - Even with those out of the way,
gettext-rson Windows requires tools such astarto be installed in the path. See also https://github.com/Koka/gettext-rs/issues/12 - It's unclear how initialisation the locale works without locale definitions.
Instead, it might make more sense to switch to gettext. Then however the burden is on on us to locale the correct .mo files.
The Slint language documentation should mention that @tr() currently doesn't work on Windows.
Any updates on this issue, or are there any workarounds available?
Oliver implemented Support for translations that are bundled with the app and don't require gettext. Those work everywhere and will be in the next release.
You can take a sneak peek here:
https://snapshots.slint.dev/master/docs/slint/guide/development/localization/#bundled-translations
https://snapshots.slint.dev/master/docs/slint/guide/development/localization/#bundled-translations
It truly helps! Thank you!
The only small issue was that the doc didn't mention that I should use the slint_build::compile_with_config function,
and that the slint::select_bundled_translation function must be called after creating the first component until I refered to the rustdoc.
Expect improved in the next release of the documentation.