1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +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
{
QLocale loc = QLocale(code);
QString name = QLocale::languageToString(loc.language());
QLocale locale = QLocale(code);
if (loc.country() != QLocale::AnyCountry) {
name.append(" / " + QLocale::countryToString(loc.country()));
QString name = QLocale::languageToString(locale.language());
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;