From 1d778676cd35ccd87102c92790df339c01a13b88 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 5 Jan 2018 12:05:35 +0800 Subject: [PATCH] Fix translation context. Closes #8211. --- src/gui/fspathedit.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/fspathedit.cpp b/src/gui/fspathedit.cpp index fbf24b0d9..2f9b0ee70 100644 --- a/src/gui/fspathedit.cpp +++ b/src/gui/fspathedit.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -40,6 +41,7 @@ namespace { + const char i18nContext[] = "FileSystemPathEdit"; struct TrStringWithComment { const char *source; @@ -47,18 +49,18 @@ namespace QString tr() const { - return QObject::tr(source, comment); + return QCoreApplication::translate(i18nContext, source, comment); } }; constexpr TrStringWithComment browseButtonBriefText = - QT_TRANSLATE_NOOP3("FileSystemPathEdit", "...", "Launch file dialog button text (brief)"); + QT_TRANSLATE_NOOP3(i18nContext, "...", "Launch file dialog button text (brief)"); constexpr TrStringWithComment browseButtonFullText = - QT_TRANSLATE_NOOP3("FileSystemPathEdit", "&Browse...", "Launch file dialog button text (full)"); + QT_TRANSLATE_NOOP3(i18nContext, "&Browse...", "Launch file dialog button text (full)"); constexpr TrStringWithComment defaultDialogCaptionForFile = - QT_TRANSLATE_NOOP3("FileSystemPathEdit", "Choose a file", "Caption for file open/save dialog"); + QT_TRANSLATE_NOOP3(i18nContext, "Choose a file", "Caption for file open/save dialog"); constexpr TrStringWithComment defaultDialogCaptionForDirectory = - QT_TRANSLATE_NOOP3("FileSystemPathEdit", "Choose a folder", "Caption for directory open dialog"); + QT_TRANSLATE_NOOP3(i18nContext, "Choose a folder", "Caption for directory open dialog"); } class FileSystemPathEdit::FileSystemPathEditPrivate