[libcalamares] Add convenience accessor for translations

- Which translations are available is a global property
   of Calamares itself, not of the plugins, so getting
   the model of available translations should live there.
   Move the relevant code (which is simple) from the
   Welcome module.
This commit is contained in:
Adriaan de Groot 2019-05-10 12:06:10 -04:00
parent 76b45a2740
commit 1857952431
3 changed files with 22 additions and 2 deletions

View file

@ -131,7 +131,7 @@ WelcomePage::initLanguages()
ui->languageWidget->clear();
ui->languageWidget->setInsertPolicy( QComboBox::InsertAtBottom );
m_languages = new CalamaresUtils::Locale::LabelModel( QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';') );
m_languages = CalamaresUtils::Locale::availableTranslations();
ui->languageWidget->setModel( m_languages );
ui->languageWidget->setItemDelegate( new LocaleTwoColumnDelegate( ui->languageWidget ) );