1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 11:02:19 +01:00

[Speller] Detect and properly display script variant

[ci skip]
This commit is contained in:
Mladen Pejaković 2014-04-04 17:26:07 +02:00 committed by nowrep
parent aa248893c1
commit 297090692f

View File

@ -405,11 +405,16 @@ QString Speller::getDictionaryPath() const
QString Speller::nameForLanguage(const QString &code) const QString Speller::nameForLanguage(const QString &code) const
{ {
QLocale loc = QLocale(code); QLocale locale = QLocale(code);
QString name = QLocale::languageToString(loc.language());
if (loc.country() != QLocale::AnyCountry) { QString name = QLocale::languageToString(locale.language());
name.append(" / " + QLocale::countryToString(loc.country())); const QString scriptName = QLocale::scriptToString(locale.script());
if (locale.country() != QLocale::AnyCountry) {
if (code.contains(QLatin1Char('-'))) {
name.append(QL1S(" (") + scriptName + QL1S(")"));
}
name.append(QL1S(" / ") + QLocale::countryToString(locale.country()));
} }
return name; return name;