summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/mimetypes')
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp2
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp1
-rw-r--r--src/corelib/mimetypes/qmimetypeparser.cpp4
3 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index c4a8458243..aac51184a4 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -502,7 +502,7 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
QString lang = xml.attributes().value(QLatin1String("xml:lang")).toString();
const QString text = xml.readElementText();
if (lang.isEmpty()) {
- lang = QLatin1String("en_US");
+ lang = QLatin1String("default"); // no locale attribute provided, treat it as default.
}
data.localeComments.insert(lang, text);
continue; // we called readElementText, so we're at the EndElement already.
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 50b8eae5c3..55c7de0c87 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -258,6 +258,7 @@ QString QMimeType::comment() const
QStringList languageList;
languageList << QLocale().name();
languageList << QLocale().uiLanguages();
+ languageList << QLatin1String("default"); // use the default locale if possible.
for (const QString &language : qAsConst(languageList)) {
const QString lang = language == QLatin1String("C") ? QLatin1String("en_US") : language;
const QString comm = d->localeComments.value(lang);
diff --git a/src/corelib/mimetypes/qmimetypeparser.cpp b/src/corelib/mimetypes/qmimetypeparser.cpp
index 7ff695bbc3..d10575cfe9 100644
--- a/src/corelib/mimetypes/qmimetypeparser.cpp
+++ b/src/corelib/mimetypes/qmimetypeparser.cpp
@@ -248,11 +248,11 @@ bool QMimeTypeParserBase::parse(QIODevice *dev, const QString &fileName, QString
}
break;
case ParseComment: {
- // comments have locale attributes. We want the default, English one
+ // comments have locale attributes.
QString locale = atts.value(QLatin1String(localeAttributeC)).toString();
const QString comment = reader.readElementText();
if (locale.isEmpty())
- locale = QString::fromLatin1("en_US");
+ locale = QString::fromLatin1("default");
data.localeComments.insert(locale, comment);
}
break;