mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
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:
parent
ebd1c2eb09
commit
d68b84a3f1
9 changed files with 140 additions and 57 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue