cargo-i18n icon indicating copy to clipboard operation
cargo-i18n copied to clipboard

Localizations don't change after setting language override and calling poll()

Open m00nwtchr opened this issue 3 years ago • 4 comments

I want to give users to option to use system locale or force a specific supported one in the app, and I'm using code adapted from the Localizer example, setting the language override before the first manual poll() works as expected, but when i do it afterwards in gui code, the language preference/order doesn't change (ie it's either still the system language or the language override i set at the start of the app). I'm using the fl! and println! macros to check the values.

https://github.com/m00nwtchr/cofd-pc-rs/blob/02aa5027ba2938f46699952871adb191205fb7d6/cofd/app/src/i18n.rs https://github.com/m00nwtchr/cofd-pc-rs/blob/02aa5027ba2938f46699952871adb191205fb7d6/cofd/app/src/main.rs#L219-L229

m00nwtchr avatar Sep 27 '22 19:09 m00nwtchr

Hi thanks for reporting, I'll look into this today!

kellpossible avatar Oct 02 '22 00:10 kellpossible

Which platform are you on by the way? The https://github.com/rust-locale/locale_config/ library used appears to be mostly abandoned and has existing issues, I haven't yet found a suitable replacement.

kellpossible avatar Oct 02 '22 00:10 kellpossible

I'm on Arch Linux (btw, lol).

m00nwtchr avatar Oct 03 '22 14:10 m00nwtchr

Hmm interesting, I'm also on Archlinux! Hopefully it will be easy for me to replicate

kellpossible avatar Oct 04 '22 07:10 kellpossible