Function slint::update_all_translations

Function Documentation

inline void slint::update_all_translations()

Forces all the strings that are translated with @tr(...) to be re-evaluated. This is useful if the language is changed at runtime. The function is only available when Slint is compiled with SLINT_FEATURE_GETTEXT.

Example

 my_ui->global<LanguageSettings>().on_french_selected([] {
    setenv("LANGUAGE", langs[l], true);
    slint::update_all_translations();
});