From 565ee701a0840998cd27589a62f9efd701ae863a Mon Sep 17 00:00:00 2001 From: Lasse Liehu Date: Sat, 31 May 2014 17:57:34 +0300 Subject: [PATCH] Fix internationalization of "txt File" in QFileDialog Some languages (for example Finnish) need to customize punctuation and capitalization in this case. Change-Id: I9720626263f061adc7972bff18bcb59f2f2b382f Reviewed-by: Stephen Kelly --- src/widgets/itemviews/qfileiconprovider.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/itemviews/qfileiconprovider.cpp b/src/widgets/itemviews/qfileiconprovider.cpp index b12ab736f4..b6b5c63f84 100644 --- a/src/widgets/itemviews/qfileiconprovider.cpp +++ b/src/widgets/itemviews/qfileiconprovider.cpp @@ -368,8 +368,10 @@ QString QFileIconProvider::type(const QFileInfo &info) const if (info.isRoot()) return QApplication::translate("QFileDialog", "Drive"); if (info.isFile()) { - if (!info.suffix().isEmpty()) - return info.suffix() + QLatin1Char(' ') + QApplication::translate("QFileDialog", "File"); + if (!info.suffix().isEmpty()) { + //: %1 is a file name suffix, for example txt + return QApplication::translate("QFileDialog", "%1 File").arg(info.suffix()); + } return QApplication::translate("QFileDialog", "File"); }