mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 02:15:36 -04:00
[packagechooser] Load translated strings as well
- This makes it possible to put the translations into the config file, and have them displayed when the Calamares language changes.
This commit is contained in:
parent
4febe477cf
commit
6e05a1ef05
3 changed files with 53 additions and 29 deletions
|
@ -232,31 +232,7 @@ PackageChooserViewStep::fillModel( const QVariantList& items )
|
|||
continue;
|
||||
}
|
||||
|
||||
QString id = CalamaresUtils::getString( item_map, "id" );
|
||||
QString package = CalamaresUtils::getString( item_map, "package" );
|
||||
QString name = CalamaresUtils::getString( item_map, "name" );
|
||||
QString description = CalamaresUtils::getString( item_map, "description" );
|
||||
QString screenshot = CalamaresUtils::getString( item_map, "screenshot" );
|
||||
|
||||
if ( name.isEmpty() && id.isEmpty() )
|
||||
{
|
||||
name = tr( "No product" );
|
||||
}
|
||||
else if ( name.isEmpty() )
|
||||
{
|
||||
cWarning() << "PackageChooser item" << id << "has an empty name.";
|
||||
continue;
|
||||
}
|
||||
if ( description.isEmpty() )
|
||||
{
|
||||
description = tr( "No description provided." );
|
||||
}
|
||||
if ( screenshot.isEmpty() )
|
||||
{
|
||||
screenshot = QStringLiteral( ":/images/no-selection.png" );
|
||||
}
|
||||
|
||||
m_model->addPackage( PackageItem { id, package, name, description, screenshot } );
|
||||
m_model->addPackage( PackageItem( item_map ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue