Change API to set the language with bundle translation

* Change API to set the language with bundle translation

Part of #6793
This commit is contained in:
Olivier Goffart 2024-11-17 11:40:02 +01:00 committed by GitHub
parent ebd1c2eb09
commit d68b84a3f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 140 additions and 57 deletions

View file

@ -1318,6 +1318,16 @@ inline void update_all_translations()
}
#endif
/// Select the current translation language when using bundled translations.
/// This function requires that the application's `.slint` file was compiled with bundled
/// translations. It must be called after creating the first component. Returns true if the language
/// was selected; false if the language was not found in the list of bundled translations.
inline bool select_bundled_translation(std::string_view locale)
{
return cbindgen_private::slint_translate_select_bundled_translation(
slint::private_api::string_to_slice(locale));
}
#if !defined(DOXYGEN)
cbindgen_private::Flickable::Flickable()
{