mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +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
|
||||
{
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user