i18n: simplify Label handling of sr@latin
This commit is contained in:
parent
85a1eb95ee
commit
740f1e7fe5
@ -56,16 +56,16 @@ Label::getLocale( const QString& localeName )
|
|||||||
{
|
{
|
||||||
return QLocale();
|
return QLocale();
|
||||||
}
|
}
|
||||||
if ( localeName.contains( "@latin" ) )
|
|
||||||
|
// Special cases
|
||||||
|
if ( localeName == QStringLiteral( "sr@latin" ) )
|
||||||
{
|
{
|
||||||
QLocale loc( localeName ); // Ignores @latin
|
QLocale loc( localeName ); // Ignores @latin
|
||||||
return QLocale( loc.language(), QLocale::Script::LatinScript, loc.country() );
|
return QLocale( loc.language(), QLocale::Script::LatinScript, loc.country() );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return QLocale( localeName );
|
return QLocale( localeName );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Locale
|
} // namespace Locale
|
||||||
} // namespace CalamaresUtils
|
} // namespace CalamaresUtils
|
||||||
|
@ -86,8 +86,9 @@ public:
|
|||||||
|
|
||||||
/** @brief Get a Qt locale for the given @p localeName
|
/** @brief Get a Qt locale for the given @p localeName
|
||||||
*
|
*
|
||||||
* This special-cases `sr@latin`, which is used as a translation
|
* This handles special-cases in Calamares translations:
|
||||||
* name in Calamares, while Qt recognizes `sr@latn`.
|
* - `sr@latin` is the name which Qt recognizes as `sr@latn`,
|
||||||
|
* Serbian written with Latin characters (not Cyrillic).
|
||||||
*/
|
*/
|
||||||
static QLocale getLocale( const QString& localeName );
|
static QLocale getLocale( const QString& localeName );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user