mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-02 20:05:37 -04:00
[keyboard] Translate layouts as well
This commit is contained in:
parent
6863db0dc1
commit
4746754344
1 changed files with 13 additions and 2 deletions
|
@ -27,7 +27,7 @@ retranslateKeyboardModels()
|
||||||
{
|
{
|
||||||
s_kbtranslator = new QTranslator;
|
s_kbtranslator = new QTranslator;
|
||||||
}
|
}
|
||||||
(void) CalamaresUtils::loadTranslator( QLocale(), QStringLiteral("kb_"), s_kbtranslator );
|
(void)CalamaresUtils::loadTranslator( QLocale(), QStringLiteral( "kb_" ), s_kbtranslator );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -165,7 +165,18 @@ KeyboardLayoutModel::data( const QModelIndex& index, int role ) const
|
||||||
switch ( role )
|
switch ( role )
|
||||||
{
|
{
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
return m_layouts.at( index.row() ).second.description;
|
{
|
||||||
|
auto description = m_layouts.at( index.row() ).second.description;
|
||||||
|
if ( s_kbtranslator && !s_kbtranslator->isEmpty() )
|
||||||
|
{
|
||||||
|
auto s = s_kbtranslator->translate( "kb_layouts", description.toUtf8().data() );
|
||||||
|
if ( !s.isEmpty() )
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return description;
|
||||||
|
}
|
||||||
case KeyboardVariantsRole:
|
case KeyboardVariantsRole:
|
||||||
return QVariant::fromValue( m_layouts.at( index.row() ).second.variants );
|
return QVariant::fromValue( m_layouts.at( index.row() ).second.variants );
|
||||||
case KeyboardLayoutKeyRole:
|
case KeyboardLayoutKeyRole:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue