Fixed Windows locale update event.

This commit is contained in:
Samuel Guerra 2023-05-26 20:07:46 -03:00
parent 9c471d392c
commit 69d47b8ee2
4 changed files with 9 additions and 6 deletions

View File

@ -28,6 +28,10 @@
* Test system lang change.
- Windows forces a log-out to change lang, how to test the event?
* Windows lang preferences still wrong, MS added a COM api that overrides what we are using.
- See https://searchfox.org/mozilla-central/source/intl/locale/windows/OSPreferences_win.cpp#87
- This is a WRT COM thing, not sure if can be called with "windows-sys" only.
* A trait that provides the available locales and locales on demand.
- Replace `L10N.load_dir` with this trait.
- Implement in-memory source.

View File

@ -13,16 +13,16 @@ use zero_ui::core::l10n::{Lang, LangMap, L10N};
// Run this command to scrap template:
// cargo run -p zero-ui-l10n-scraper -- -i"examples/localize*" -o"examples/res/localize"
use zero_ui_view_prebuilt as zero_ui_view;
// use zero_ui_view_prebuilt as zero_ui_view;
fn main() {
examples_util::print_info();
zero_ui_view::init();
// zero_ui_view::init();
// let rec = examples_util::record_profile("localize");
// zero_ui_view::run_same_process(app_main);
app_main();
zero_ui_view::run_same_process(app_main);
// app_main();
// rec.finish();
}

View File

@ -26,7 +26,6 @@ pub struct L10N;
///
/// * [`L10N`]
///
///
/// # Default
///
/// This extension is included in the [default app].

View File

@ -90,7 +90,7 @@ fn config_listener(event_loop: crate::AppEventSender) {
std::slice::from_raw_parts(p_str, len as _)
};
match b_str {
b"intl" => notify(Event::LocaleChanged(locale_config())),
b"i" | b"intl" => notify(Event::LocaleChanged(locale_config())),
_ => None,
}
}