C++: allow to configure bundled translation

This commit is contained in:
Olivier Goffart 2024-11-18 15:57:08 +01:00 committed by GitHub
parent fb6ab7a1b8
commit 014b58c81a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 41 additions and 9 deletions

View file

@ -82,6 +82,11 @@ int main()
setenv("LANGUAGE", langs[l], true);
slint::update_all_translations();
});
#else
printer_demo->global<PrinterSettings>().on_change_language([](int l) {
static const char *langs[] = { "", "fr" };
slint::select_bundled_translation(langs[l]);
});
#endif
printer_demo->run();