i18n: introduce special case for ca@valencia

main
Adriaan de Groot 3 years ago
parent 740f1e7fe5
commit 0e977a7e42

@ -63,6 +63,10 @@ Label::getLocale( const QString& localeName )
QLocale loc( localeName ); // Ignores @latin
return QLocale( loc.language(), QLocale::Script::LatinScript, loc.country() );
}
if ( localeName == QStringLiteral( "ca@valencia" ) )
{
return QLocale( localeName ); // Ignores @valencia, but there is **really** no way to handle this
}
return QLocale( localeName );
}

@ -27,6 +27,12 @@ namespace Locale
* Support class to turn locale names (as used by Calamares's
* translation system) into QLocales, and also into consistent
* human-readable text labels.
*
* This handles special-cases in Calamares translations:
* - `sr@latin` is the name which Qt recognizes as `sr@latn`,
* Serbian written with Latin characters (not Cyrillic).
* - `ca@valencia` is the Catalan dialect spoken in Valencia.
* There is no Qt code for it.
*/
class Label : public QObject
{
@ -86,9 +92,7 @@ public:
/** @brief Get a Qt locale for the given @p localeName
*
* This handles special-cases in Calamares translations:
* - `sr@latin` is the name which Qt recognizes as `sr@latn`,
* Serbian written with Latin characters (not Cyrillic).
* This obeys special cases as described in the class documentation.
*/
static QLocale getLocale( const QString& localeName );

Loading…
Cancel
Save