Commit fe670ea0 authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Fix untranslated QT_TRANSLATE_NOOP strings not found by lupdate.

Qt's lupdate only finds very basic QT_TRANSLATE_NOOP constructs.
This caused many translated strings not to be transfered from the
translated po-file to the intermediate ts-file and then missing
in the qm-file and the translation.
QTBUG-46190 was closed but not fixed.
parent 6b5146b9
......@@ -258,9 +258,9 @@ QString KdePlatformTools::getOpenFileName(QWidget* parent,
if (selectedFilter) {
QString selectedFile;
KFileDialog diag(dir, filter, parent);
const char* const openStr = QT_TRANSLATE_NOOP("@default", "Open");
diag.setWindowTitle(caption.isEmpty()
? QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "Open"))
? QCoreApplication::translate("@default", openStr)
: caption);
if (diag.exec() == QDialog::Accepted) {
selectedFile = diag.selectedFile();
......@@ -295,9 +295,9 @@ QStringList KdePlatformTools::getOpenFileNames(QWidget* parent,
if (selectedFilter) {
QStringList selectedFiles;
KFileDialog diag(dir, filter, parent);
const char* const openStr = QT_TRANSLATE_NOOP("@default", "Open");
diag.setWindowTitle(caption.isEmpty()
? QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "Open"))
? QCoreApplication::translate("@default", openStr)
: caption);
diag.setMode(KFile::Files | KFile::LocalOnly);
if (diag.exec() == QDialog::Accepted) {
......@@ -334,9 +334,9 @@ QString KdePlatformTools::getSaveFileName(QWidget* parent,
QString selectedFile;
KFileDialog diag(dir, filter, parent);
diag.setOperationMode(KFileDialog::Saving);
const char* const saveAsStr = QT_TRANSLATE_NOOP("@default", "Save As");
diag.setWindowTitle(caption.isEmpty()
? QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "Save As"))
? QCoreApplication::translate("@default", saveAsStr)
: caption);
if (diag.exec() == QDialog::Accepted) {
selectedFile = diag.selectedFile();
......
......@@ -109,9 +109,11 @@ int main(int argc, char* argv[])
parser.setApplicationDescription(aboutData.shortDescription());
parser.addHelpOption();
parser.addVersionOption();
const char* const directoryToOpenStr =
QT_TRANSLATE_NOOP("@default", "directory to open");
parser.addPositionalArgument(
QStringLiteral("dir"), QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "directory to open")),
directoryToOpenStr),
QStringLiteral("[dir...]"));
parser.process(app);
aboutData.processCommandLine(&parser);
......@@ -120,9 +122,10 @@ int main(int argc, char* argv[])
KConfigGroup(KSharedConfig::openConfig(), "Locale").readEntry("Language");
Utils::loadTranslation(configuredLanguage);
const char* const audioTagEditorStr =
QT_TRANSLATE_NOOP("@default", "Audio Tag Editor");
aboutData.setShortDescription(
QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "Audio Tag Editor")));
QCoreApplication::translate("@default", audioTagEditorStr));
aboutData.setTranslator(
QCoreApplication::translate("@default",
// i18n NAME OF TRANSLATORS
......@@ -227,8 +230,10 @@ int main(int argc, char* argv[])
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineOptions options;
const char* const directoryToOpenStr =
QT_TRANSLATE_NOOP("@default", "directory to open");
options.add("+[Dir]", ki18n("%1").subs(QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "directory to open"))));
directoryToOpenStr)));
KCmdLineArgs::addCmdLineOptions(options);
Kid3KdeApplication app;
......@@ -236,9 +241,11 @@ int main(int argc, char* argv[])
KConfigGroup(KGlobal::config(), "Locale").readEntry("Language");
Utils::loadTranslation(configuredLanguage);
const char* const audioTagEditorStr =
QT_TRANSLATE_NOOP("@default", "Audio Tag Editor");
aboutData.setShortDescription(
ki18n("%1").subs(QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "Audio Tag Editor"))));
audioTagEditorStr)));
aboutData.setTranslator(
ki18n("%1").subs(QCoreApplication::translate("@default",
// i18n NAME OF TRANSLATORS
......
......@@ -86,8 +86,9 @@ bool PlatformTools::moveToTrash(const QString& path) const
void PlatformTools::displayHelp(const QString& anchor)
{
if (!m_helpBrowser) {
QString caption(QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "Kid3 Handbook")));
const char* const kid3HandbookStr =
QT_TRANSLATE_NOOP("@default", "Kid3 Handbook");
QString caption(QCoreApplication::translate("@default", kid3HandbookStr));
m_helpBrowser = new BrowserDialog(0, caption);
}
m_helpBrowser->goToAnchor(anchor);
......
......@@ -63,7 +63,8 @@ QString ImportParser::getFormatToolTip()
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%y</td><td>%{year}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Year"));
const char* const yearStr = QT_TRANSLATE_NOOP("@default", "Year");
str += QCoreApplication::translate("@default", yearStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%t</td><td>%{track}</td><td>");
......@@ -75,7 +76,8 @@ QString ImportParser::getFormatToolTip()
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%d</td><td>%{duration}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Length"));
const char* const lengthStr = QT_TRANSLATE_NOOP("@default", "Length");
str += QCoreApplication::translate("@default", lengthStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("</table>\n");
......
......@@ -150,7 +150,8 @@ QString CommandFormatReplacer::getToolTip(bool onlyRows)
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%F</td><td>%{files}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Filenames"));
const char* const filenamesStr = QT_TRANSLATE_NOOP("@default", "Filenames");
str += QCoreApplication::translate("@default", filenamesStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%uf</td><td>%{url}</td><td>");
......@@ -158,11 +159,14 @@ QString CommandFormatReplacer::getToolTip(bool onlyRows)
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%uF</td><td>%{urls}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "URLs"));
const char* const urlsStr = QT_TRANSLATE_NOOP("@default", "URLs");
str += QCoreApplication::translate("@default", urlsStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%d</td><td>%{directory}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Directory name"));
const char* const directoryNameStr =
QT_TRANSLATE_NOOP("@default", "Directory name");
str += QCoreApplication::translate("@default", directoryNameStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%b</td><td>%{browser}</td><td>");
......@@ -171,24 +175,34 @@ QString CommandFormatReplacer::getToolTip(bool onlyRows)
#ifdef CFG_QMLDIR
str += QLatin1String("<tr><td>%q</td><td>%{qmlpath}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "QML base directory"));
const char* const qmlBaseDirectoryStr =
QT_TRANSLATE_NOOP("@default", "QML base directory");
str += QCoreApplication::translate("@default", qmlBaseDirectoryStr);
str += QLatin1String("</td></tr>\n");
#endif
str += QLatin1String("<tr><td>%ua...</td><td>%u{artist}...</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Encode as URL"));
const char* const encodeAsUrlStr =
QT_TRANSLATE_NOOP("@default", "Encode as URL");
str += QCoreApplication::translate("@default", encodeAsUrlStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>@separator</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "--- separator ---"));
const char* const separatorStr =
QT_TRANSLATE_NOOP("@default", "--- separator ---");
str += QCoreApplication::translate("@default", separatorStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>@beginmenu</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Begin of submenu"));
const char* const beginOfSubmenuStr =
QT_TRANSLATE_NOOP("@default", "Begin of submenu");
str += QCoreApplication::translate("@default", beginOfSubmenuStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>@endmenu</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "End of submenu"));
const char* const endOfSubmenuStr =
QT_TRANSLATE_NOOP("@default", "End of submenu");
str += QCoreApplication::translate("@default", endOfSubmenuStr);
str += QLatin1String("</td></tr>\n");
if (!onlyRows) str += QLatin1String("</table>\n");
......
......@@ -104,8 +104,9 @@ QString EventTimeCode::toTranslatedString() const
return QCoreApplication::translate("@default", codes[i].text);
}
}
return QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "reserved for future use %1")).
const char* const reservedForFutureUseStr =
QT_TRANSLATE_NOOP("@default", "reserved for future use %1");
return QCoreApplication::translate("@default", reservedForFutureUseStr).
arg(m_code, 2, 16, QLatin1Char('0'));
}
......
......@@ -112,27 +112,39 @@ QString FileFilter::getFormatToolTip(bool onlyRows)
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>equals</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "True if strings are equal"));
const char* const trueIfStringsAreEqualStr =
QT_TRANSLATE_NOOP("@default", "True if strings are equal");
str += QCoreApplication::translate("@default", trueIfStringsAreEqualStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>contains</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "True if string contains substring"));
const char* const trueIfStringContainsSubstringStr =
QT_TRANSLATE_NOOP("@default", "True if string contains substring");
str += QCoreApplication::translate("@default",
trueIfStringContainsSubstringStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>matches</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "True if string matches regexp"));
const char* const trueIfStringMatchesRegexpStr =
QT_TRANSLATE_NOOP("@default", "True if string matches regexp");
str += QCoreApplication::translate("@default", trueIfStringMatchesRegexpStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>and</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Logical AND"));
const char* const logicalAndStr =
QT_TRANSLATE_NOOP("@default", "Logical AND");
str += QCoreApplication::translate("@default", logicalAndStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>or</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Logical OR"));
const char* const logicalOrStr = QT_TRANSLATE_NOOP("@default", "Logical OR");
str += QCoreApplication::translate("@default", logicalOrStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>not</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Logical negation"));
const char* const logicalNegationStr =
QT_TRANSLATE_NOOP("@default", "Logical negation");
str += QCoreApplication::translate("@default", logicalNegationStr);
str += QLatin1String("</td></tr>\n");
if (!onlyRows) str += QLatin1String("</table>\n");
......
......@@ -1218,19 +1218,21 @@ QString FrameFormatReplacer::getToolTip(bool onlyRows)
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%y</td><td>%{year}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Year"));
const char* const yearStr = QT_TRANSLATE_NOOP("@default", "Year");
str += QCoreApplication::translate("@default", yearStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%t</td><td>%{track}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Track"));
const char* const trackStr = QT_TRANSLATE_NOOP("@default", "Track");
str += QCoreApplication::translate("@default", trackStr);
str += QLatin1String(" &quot;01&quot;</td></tr>\n");
str += QLatin1String("<tr><td>%t</td><td>%{track.3}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Track"));
str += QCoreApplication::translate("@default", trackStr);
str += QLatin1String(" &quot;001&quot;</td></tr>\n");
str += QLatin1String("<tr><td>%T</td><td>%{tracknumber}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Track"));
str += QCoreApplication::translate("@default", trackStr);
str += QLatin1String(" &quot;1&quot;</td></tr>\n");
str += QLatin1String("<tr><td>%g</td><td>%{genre}</td><td>");
......
......@@ -180,7 +180,9 @@ QString TrackDataFormatReplacer::getToolTip(bool onlyRows)
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%p</td><td>%{filepath}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Absolute path to file"));
const char* const absolutePathToFileStr =
QT_TRANSLATE_NOOP("@default", "Absolute path to file");
str += QCoreApplication::translate("@default", absolutePathToFileStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%u</td><td>%{url}</td><td>");
......@@ -188,19 +190,23 @@ QString TrackDataFormatReplacer::getToolTip(bool onlyRows)
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%d</td><td>%{duration}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Length"));
const char* const lengthStr = QT_TRANSLATE_NOOP("@default", "Length");
str += QCoreApplication::translate("@default", lengthStr);
str += QLatin1String(" &quot;M:S&quot;</td></tr>\n");
str += QLatin1String("<tr><td>%D</td><td>%{seconds}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Length"));
str += QCoreApplication::translate("@default", lengthStr);
str += QLatin1String(" &quot;S&quot;</td></tr>\n");
str += QLatin1String("<tr><td>%n</td><td>%{tracks}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Number of tracks"));
const char* const numberOfTracksStr =
QT_TRANSLATE_NOOP("@default", "Number of tracks");
str += QCoreApplication::translate("@default", numberOfTracksStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%e</td><td>%{extension}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Extension"));
const char* const extensionStr = QT_TRANSLATE_NOOP("@default", "Extension");
str += QCoreApplication::translate("@default", extensionStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%O</td><td>%{tag1}</td><td>");
......@@ -212,29 +218,36 @@ QString TrackDataFormatReplacer::getToolTip(bool onlyRows)
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%b</td><td>%{bitrate}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Bitrate"));
const char* const bitrateStr = QT_TRANSLATE_NOOP("@default", "Bitrate");
str += QCoreApplication::translate("@default", bitrateStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%v</td><td>%{vbr}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "VBR"));
const char* const vbrStr = QT_TRANSLATE_NOOP("@default", "VBR");
str += QCoreApplication::translate("@default", vbrStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%r</td><td>%{samplerate}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Samplerate"));
const char* const samplerateStr = QT_TRANSLATE_NOOP("@default", "Samplerate");
str += QCoreApplication::translate("@default", samplerateStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%m</td><td>%{mode}</td><td>Stereo, Joint Stereo</td></tr>\n");
str += QLatin1String("<tr><td>%C</td><td>%{channels}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Channels"));
const char* const channelsStr = QT_TRANSLATE_NOOP("@default", "Channels");
str += QCoreApplication::translate("@default", channelsStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%k</td><td>%{codec}</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Codec"));
const char* const codecStr = QT_TRANSLATE_NOOP("@default", "Codec");
str += QCoreApplication::translate("@default", codecStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td>%ha...</td><td>%h{artist}...</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Escape for HTML"));
const char* const escapeForHtmlStr =
QT_TRANSLATE_NOOP("@default", "Escape for HTML");
str += QCoreApplication::translate("@default", escapeForHtmlStr);
str += QLatin1String("</td></tr>\n");
if (!onlyRows) str += QLatin1String("</table>\n");
......
......@@ -56,7 +56,9 @@ static QString getToolTip()
str += FrameFormatReplacer::getToolTip(true);
str += QLatin1String("<tr><td>%ua...</td><td>%u{artist}...</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Encode as URL"));
const char* const encodeAsUrlStr =
QT_TRANSLATE_NOOP("@default", "Encode as URL");
str += QCoreApplication::translate("@default", encodeAsUrlStr);
str += QLatin1String("</td></tr>\n");
str += QLatin1String("</table>\n");
......
......@@ -901,13 +901,14 @@ QWidget* BinFieldControl::createWidget(QWidget* parent)
}
if (m_frame.getType() == Frame::FT_Picture) {
m_bos->setDefaultFile(FileConfig::instance().defaultCoverFileName());
const char* const imagesStr = QT_TRANSLATE_NOOP("@default", "Images");
const char* const allFilesStr = QT_TRANSLATE_NOOP("@default", "All Files");
m_bos->setFilter(m_platformTools->fileDialogNameFilter(
QList<QPair<QString, QString> >()
<< qMakePair(QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "Images")),
<< qMakePair(QCoreApplication::translate("@default", imagesStr),
QString(QLatin1String("*.jpg *.jpeg *.png")))
<< qMakePair(QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "All Files")),
allFilesStr),
QString(QLatin1Char('*')))));
}
return m_bos;
......
......@@ -315,13 +315,13 @@ void TimeEventEditor::exportData()
*/
QString TimeEventEditor::getLrcNameFilter() const
{
const char* const lyricsStr = QT_TRANSLATE_NOOP("@default", "Lyrics");
const char* const allFilesStr = QT_TRANSLATE_NOOP("@default", "All Files");
return m_platformTools->fileDialogNameFilter(
QList<QPair<QString, QString> >()
<< qMakePair(QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "Lyrics")),
<< qMakePair(QCoreApplication::translate("@default", lyricsStr),
QString(QLatin1String("*.lrc")))
<< qMakePair(QCoreApplication::translate("@default",
QT_TRANSLATE_NOOP("@default", "All Files")),
<< qMakePair(QCoreApplication::translate("@default", allFilesStr),
QString(QLatin1Char('*'))));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment