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:
parent
aa248893c1
commit
297090692f
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user