Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9672ae2b authored by Pino Toscano's avatar Pino Toscano

i18n fixes

- remove string puzzles
- pass correctly the arguments to i18n()
- remove the default title for KMessageBox::error()
- remove contractions ("hasn't" -> "has not", etc)
- remove extra newlines at the end of some error messages
- style fixes
parent e07b097d
......@@ -90,7 +90,7 @@ QList<QAction*> KDiff3FileItemAction::actions( const KFileItemListProperties& fi
//pThis->m_fileItemInfos = fileItemInfos;
pThis->m_pParentWidget = pParentWidget;
QAction *pMenuAction = new QAction(QIcon::fromTheme(QStringLiteral("kdiff3")), i18n("KDiff3 ..."), pThis);
QAction *pMenuAction = new QAction(QIcon::fromTheme(QStringLiteral("kdiff3")), i18n("KDiff3..."), pThis);
QMenu *pActionMenu = new QMenu();
pMenuAction->setMenu( pActionMenu );
......@@ -147,7 +147,7 @@ QList<QAction*> KDiff3FileItemAction::actions( const KFileItemListProperties& fi
if (s_pHistory && !s_pHistory->empty())
{
QAction* pHistoryMenuAction = new QAction( i18n("Compare with ..."), pThis );
QAction* pHistoryMenuAction = new QAction( i18n("Compare with..."), pThis );
QMenu* pHistoryMenu = new QMenu();
pHistoryMenuAction->setMenu( pHistoryMenu );
pHistoryMenu->setEnabled( m_list.count()>0 && historyCount>0 );
......@@ -177,7 +177,7 @@ QList<QAction*> KDiff3FileItemAction::actions( const KFileItemListProperties& fi
connect(pAction, &QAction::triggered, this, &KDiff3FileItemAction::slotCompareThreeFiles);
pActionMenu->addAction (pAction);
}
pAction = new QAction (i18n("About KDiff3 menu plugin ..."), pThis);
pAction = new QAction (i18n("About KDiff3 menu plugin..."), pThis);
connect(pAction, &QAction::triggered, this, &KDiff3FileItemAction::slotAbout);
pActionMenu->addAction (pAction);
......@@ -287,10 +287,10 @@ void KDiff3FileItemAction::slotAbout()
{
QString s = i18n("KDiff3 File Item Action Plugin: Copyright (C) 2011 Joachim Eibl\n"
"KDiff3 homepage: http://kdiff3.sourceforge.net\n\n");
s += i18n("Using the contextmenu extension:\n"
s += i18n("Using the context menu extension:\n"
"For simple comparison of two selected files choose \"Compare\".\n"
"If the other file is somewhere else \"Save\" the first file for later. "
"It will appear in the \"Compare With ...\" submenu. "
"It will appear in the \"Compare with...\" submenu. "
"Then use \"Compare With\" on the second file.\n"
"For a 3-way merge first \"Save\" the base file, then the branch to merge and "
"choose \"3-way merge with base\" on the other branch which will be used as destination.\n"
......
......@@ -710,8 +710,7 @@ QStringList SourceData::readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetec
errors.append(
i18n("Preprocessing possibly failed. Check this command:\n\n %1"
"\n\nThe preprocessing command will be disabled now.")
.arg(ppCmd) +
"\n\nThe preprocessing command will be disabled now.", ppCmd) +
errorReason);
m_pOptions->m_PreProcessorCmd = "";
m_normalData.readFile(fileNameIn1);
......@@ -759,8 +758,7 @@ QStringList SourceData::readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetec
{
errors.append(
i18n("The line-matching-preprocessing possibly failed. Check this command:\n\n %1"
"\n\nThe line-matching-preprocessing command will be disabled now.")
.arg(ppCmd) +
"\n\nThe line-matching-preprocessing command will be disabled now.", ppCmd) +
errorReason);
m_pOptions->m_LineMatchingPreProcessorCmd = "";
m_lmppData.readFile(fileNameIn2);
......
......@@ -408,11 +408,11 @@ void DiffTextWindow::showStatusLine(int line)
{
int l = pD3l->getLineInFile(d->m_winIdx);
QString s = i18n("File") + " " + d->m_filename;
QString s;
if(l != -1)
s += ": " + i18n("Line") + " " + QString::number(l + 1);
s = i18n("File %1: Line %2", d->m_filename, l + 1);
else
s += ": " + i18n("Line not available");
s = i18n("File %1: Line not available", d->m_filename);
if(d->m_pStatusBar != nullptr) d->m_pStatusBar->showMessage(s);
emit lineClicked(d->m_winIdx, l);
......@@ -1940,8 +1940,8 @@ void DiffTextWindowFrame::init()
d->m_pFileSelection->setText(s);
QString winId = pDTW->d->m_winIdx == 1 ? (pDTW->d->m_bTriple ? "A (Base)" : "A") : (pDTW->d->m_winIdx == 2 ? "B" : "C");
d->m_pLabel->setText(winId + ":");
d->m_pEncoding->setText(i18n("Encoding:") + " " + (pDTW->d->m_pTextCodec != nullptr ? pDTW->d->m_pTextCodec->name() : QString()));
d->m_pLineEndStyle->setText(i18n("Line end style:") + " " + (pDTW->d->m_eLineEndStyle == eLineEndStyleDos ? i18n("DOS") : i18n("Unix")));
d->m_pEncoding->setText(i18n("Encoding: %1", pDTW->d->m_pTextCodec != nullptr ? pDTW->d->m_pTextCodec->name() : QString()));
d->m_pLineEndStyle->setText(i18n("Line end style: %1", pDTW->d->m_eLineEndStyle == eLineEndStyleDos ? i18n("DOS") : i18n("Unix")));
}
}
......
......@@ -1289,13 +1289,14 @@ bool DirectoryMergeWindow::Data::init(
nofFiles, nofDirs, nofEqualFiles, nofManualMerges);
QString s;
s = i18n("Directory Comparison Status") + "\n\n" +
i18n("Number of subdirectories:") + " " + QString::number(nofDirs) + "\n" +
i18n("Number of equal files:") + " " + QString::number(nofEqualFiles) + "\n" +
i18n("Number of different files:") + " " + QString::number(nofFiles - nofEqualFiles);
s = i18n("Directory Comparison Status\n\n"
"Number of subdirectories: %1\n"
"Number of equal files: %2\n"
"Number of different files: %3",
nofDirs, nofEqualFiles, nofFiles - nofEqualFiles);
if(m_dirC.isValid())
s += "\n" + i18n("Number of manual merges:") + " " + QString::number(nofManualMerges);
s += "\n" + i18n("Number of manual merges: %1", nofManualMerges);
KMessageBox::information(q, s);
//
//TODO
......@@ -1884,7 +1885,7 @@ void DirectoryMergeWindow::Data::prepareListView(ProgressProxy& pp)
const QString& fileName = mfi.subPath();
pp.setInformation(
i18n("Processing ") + QString::number(currentIdx) + " / " + QString::number(nrOfFiles) + "\n" + fileName, currentIdx, false);
i18n("Processing %1 / %2\n%3", currentIdx, nrOfFiles, fileName), currentIdx, false);
if(pp.wasCancelled()) break;
++currentIdx;
......@@ -2557,7 +2558,7 @@ void DirectoryMergeWindow::mergeResultSaved(const QString& fileName)
bool bSuccess = d->copyFLD(d->fullNameB(mfi), d->fullNameA(mfi));
if(!bSuccess)
{
KMessageBox::error(this, i18n("An error occurred while copying.\n"), i18n("Error"));
KMessageBox::error(this, i18n("An error occurred while copying."));
d->m_pStatusInfo->setWindowTitle(i18n("Merge Error"));
d->m_pStatusInfo->exec();
//if ( m_pStatusInfo->firstChild()!=0 )
......@@ -2635,7 +2636,7 @@ bool DirectoryMergeWindow::Data::executeMergeOperation(MergeFileInfos& mfi, bool
destName = fullNameDest(mfi);
break;
default:
KMessageBox::error(q, i18n("Unknown merge operation. (This must never happen!)"), i18n("Error"));
KMessageBox::error(q, i18n("Unknown merge operation. (This must never happen!)"));
}
bool bSuccess = false;
......@@ -2680,7 +2681,7 @@ bool DirectoryMergeWindow::Data::executeMergeOperation(MergeFileInfos& mfi, bool
destName, bSingleFileMerge);
break;
default:
KMessageBox::error(q, i18n("Unknown merge operation."), i18n("Error"));
KMessageBox::error(q, i18n("Unknown merge operation."));
}
return bSuccess;
......@@ -2740,7 +2741,7 @@ void DirectoryMergeWindow::Data::prepareMergeStart(const QModelIndex& miBegin, c
{
q->scrollTo(mi, QAbstractItemView::EnsureVisible);
q->setCurrentIndex(mi);
KMessageBox::error(q, errorText, i18n("Error"));
KMessageBox::error(q, errorText);
m_mergeItemList.clear();
m_bRealMergeStarted = false;
return;
......@@ -2998,7 +2999,7 @@ void DirectoryMergeWindow::Data::mergeContinue(bool bStart, bool bVerbose)
q->scrollTo(miCurrent, EnsureVisible);
if(!bSuccess && !bSingleFileMerge)
{
KMessageBox::error(q, i18n("An error occurred. Press OK to see detailed information.\n"), i18n("Error"));
KMessageBox::error(q, i18n("An error occurred. Press OK to see detailed information."));
m_pStatusInfo->setWindowTitle(i18n("Merge Error"));
m_pStatusInfo->exec();
//if ( m_pStatusInfo->firstChild()!=0 )
......
......@@ -945,15 +945,15 @@ bool FileAccess::createBackup(const QString& bakExtension)
bool bSuccess = bakFile.removeFile();
if(!bSuccess)
{
setStatusText(i18n("While trying to make a backup, deleting an older backup failed. \nFilename: ") + bakName);
setStatusText(i18n("While trying to make a backup, deleting an older backup failed.\nFilename: %1", bakName));
return false;
}
}
bool bSuccess = rename(bakName);
if(!bSuccess)
{
setStatusText(i18n("While trying to make a backup, renaming failed. \nFilenames: ") +
absoluteFilePath() + " -> " + bakName);
setStatusText(i18n("While trying to make a backup, renaming failed.\nFilenames: %1 -> %2",
absoluteFilePath(), bakName));
return false;
}
}
......@@ -1554,7 +1554,7 @@ bool FileAccessJobHandler::listDir(t_DirectoryList* pDirList, bool bRecursive, b
if(pp.wasCancelled())
return true; // Cancelled is not an error.
pp.setInformation(i18n("Reading directory: ") + m_pFileAccess->absoluteFilePath(), 0, false);
pp.setInformation(i18n("Reading directory: %1", m_pFileAccess->absoluteFilePath()), 0, false);
if(m_pFileAccess->isLocal())
{
......
......@@ -689,7 +689,7 @@ bool KDiff3App::queryClose()
if(m_bOutputModified)
{
int result = KMessageBox::warningYesNoCancel(this,
i18n("The merge result hasn't been saved."),
i18n("The merge result has not been saved."),
i18n("Warning"),
KGuiItem(i18n("Save && Quit")),
KGuiItem(i18n("Quit Without Saving")));
......@@ -993,7 +993,7 @@ void KDiff3App::slotFilePrint()
painter.drawLine(0, view.bottom() + 3, view.width(), view.bottom() + 3);
QString s = bPrintCurrentPage ? QString("")
: QString::number(page) + "/" + QString::number(totalNofPages);
if(bPrintSelection) s += " (" + i18n("Selection") + ")";
if(bPrintSelection) s += i18n(" (Selection)");
painter.drawText((view.right() - painter.fontMetrics().width(s)) / 2,
view.bottom() + painter.fontMetrics().ascent() + 5, s);
......
......@@ -170,7 +170,7 @@ bool KDiff3Part::openFile()
if(fileName1.isEmpty() && fileName2.isEmpty())
{
KMessageBox::sorry(m_widget, i18n("Couldn't find files for comparison."));
KMessageBox::sorry(m_widget, i18n("Could not find files for comparison."));
return false;
}
......@@ -246,7 +246,7 @@ bool KDiff3Part::openFile()
}
else
{
KMessageBox::sorry(m_widget, i18n("Couldn't find files for comparison."));
KMessageBox::sorry(m_widget, i18n("Could not find files for comparison."));
}
return true;
......
......@@ -142,7 +142,7 @@ int main(int argc, char* argv[])
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("o") << QLatin1String("output"), i18n("Output file. Implies -m. E.g.: -o newfile.txt"), QLatin1String("file")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("out"), i18n("Output file, again. (For compatibility with certain tools.)"), QLatin1String("file")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("auto"), i18n("No GUI if all conflicts are auto-solvable. (Needs -o file)")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("qall"), i18n("Don't solve conflicts automatically.")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("qall"), i18n("Do not solve conflicts automatically.")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("L1"), i18n("Visible name replacement for input file 1 (base)."), QLatin1String("alias1")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("L2"), i18n("Visible name replacement for input file 2."), QLatin1String("alias2")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("L3"), i18n("Visible name replacement for input file 3."), QLatin1String("alias3")));
......
......@@ -923,10 +923,12 @@ void MergeResultWindow::showNrOfConflicts()
int nrOfUnsolvedConflicts = getNrOfUnsolvedConflicts();
KMessageBox::information(this,
i18n("Total number of conflicts: ") + QString::number(nrOfConflicts) +
i18n("\nNr of automatically solved conflicts: ") + QString::number(nrOfConflicts - nrOfUnsolvedConflicts) +
i18n("\nNr of unsolved conflicts: ") + QString::number(nrOfUnsolvedConflicts) +
"\n" + totalInfo,
i18n("Total number of conflicts: %1\n"
"Nr of automatically solved conflicts: %2\n"
"Nr of unsolved conflicts: %3\n"
"%4",
nrOfConflicts, nrOfConflicts - nrOfUnsolvedConflicts,
nrOfUnsolvedConflicts, totalInfo),
i18n("Conflicts"));
}
......@@ -2912,7 +2914,7 @@ bool MergeResultWindow::saveDocument(const QString& fileName, QTextCodec* pEncod
{
KMessageBox::error(this,
i18n("Not all conflicts are solved yet.\n"
"File not saved.\n"),
"File not saved."),
i18n("Conflicts Left"));
return false;
}
......@@ -2921,7 +2923,7 @@ bool MergeResultWindow::saveDocument(const QString& fileName, QTextCodec* pEncod
{
KMessageBox::error(this,
i18n("There is a line end style conflict. Please choose the line end style manually.\n"
"File not saved.\n"),
"File not saved."),
i18n("Conflicts Left"));
return false;
}
......@@ -3342,7 +3344,7 @@ WindowTitleWidget::WindowTitleWidget(Options* pOptions)
pHLayout->setMargin(2);
pHLayout->setSpacing(2);
m_pLabel = new QLabel(i18n("Output") + ":");
m_pLabel = new QLabel(i18n("Output:"));
pHLayout->addWidget(m_pLabel);
m_pFileNameLineEdit = new QLineEdit();
......@@ -3361,7 +3363,7 @@ WindowTitleWidget::WindowTitleWidget(Options* pOptions)
pHLayout->addStretch(1);
m_pEncodingLabel = new QLabel(i18n("Encoding for saving") + ":");
m_pEncodingLabel = new QLabel(i18n("Encoding for saving:"));
pHLayout->addWidget(m_pEncodingLabel);
m_pEncodingSelector = new QComboBox();
......@@ -3492,11 +3494,11 @@ void WindowTitleWidget::setEncodings(QTextCodec* pCodecForA, QTextCodec* pCodecF
}
if(pCodecForA)
m_pEncodingSelector->addItem(i18n("Codec from") + " A: " + pCodecForA->name(), QVariant::fromValue((void*)pCodecForA));
m_pEncodingSelector->addItem(i18n("Codec from A: %1", QLatin1String(pCodecForA->name())), QVariant::fromValue((void*)pCodecForA));
if(pCodecForB)
m_pEncodingSelector->addItem(i18n("Codec from") + " B: " + pCodecForB->name(), QVariant::fromValue((void*)pCodecForB));
m_pEncodingSelector->addItem(i18n("Codec from B: %1", QLatin1String(pCodecForB->name())), QVariant::fromValue((void*)pCodecForB));
if(pCodecForC)
m_pEncodingSelector->addItem(i18n("Codec from") + " C: " + pCodecForC->name(), QVariant::fromValue((void*)pCodecForC));
m_pEncodingSelector->addItem(i18n("Codec from C: %1", QLatin1String(pCodecForC->name())), QVariant::fromValue((void*)pCodecForC));
std::map<QString, QTextCodec*>::iterator it;
for(it = names.begin(); it != names.end(); ++it)
......
......@@ -962,21 +962,19 @@ void OptionDialog::setupDiffPage(void)
);
++line;
*/
QString treatAsWhiteSpace = " (" + i18n("Treat as white space.") + ")";
OptionCheckBox* pIgnoreNumbers = new OptionCheckBox(i18n("Ignore numbers") + treatAsWhiteSpace, false, "IgnoreNumbers", &m_options.m_bIgnoreNumbers, page, this);
OptionCheckBox* pIgnoreNumbers = new OptionCheckBox(i18n("Ignore numbers (treat as white space)"), false, "IgnoreNumbers", &m_options.m_bIgnoreNumbers, page, this);
gbox->addWidget(pIgnoreNumbers, line, 0, 1, 2);
pIgnoreNumbers->setToolTip(i18n(
"Ignore number characters during line matching phase. (Similar to Ignore white space.)\n"
"Might help to compare files with numeric data."));
++line;
OptionCheckBox* pIgnoreComments = new OptionCheckBox(i18n("Ignore C/C++ comments") + treatAsWhiteSpace, false, "IgnoreComments", &m_options.m_bIgnoreComments, page, this);
OptionCheckBox* pIgnoreComments = new OptionCheckBox(i18n("Ignore C/C++ comments (treat as white space)"), false, "IgnoreComments", &m_options.m_bIgnoreComments, page, this);
gbox->addWidget(pIgnoreComments, line, 0, 1, 2);
pIgnoreComments->setToolTip(i18n("Treat C/C++ comments like white space."));
++line;
OptionCheckBox* pIgnoreCase = new OptionCheckBox(i18n("Ignore case") + treatAsWhiteSpace, false, "IgnoreCase", &m_options.m_bIgnoreCase, page, this);
OptionCheckBox* pIgnoreCase = new OptionCheckBox(i18n("Ignore case (treat as white space)"), false, "IgnoreCase", &m_options.m_bIgnoreCase, page, this);
gbox->addWidget(pIgnoreCase, line, 0, 1, 2);
pIgnoreCase->setToolTip(i18n(
"Treat case differences like white space changes. ('a'<=>'A')"));
......@@ -1366,7 +1364,7 @@ void OptionDialog::setupDirectoryMergePage(void)
OptionCheckBox* pCopyNewer = new OptionCheckBox(i18n("Copy newer instead of merging (unsafe)"), false, "CopyNewer", &m_options.m_bDmCopyNewer, page, this);
gbox->addWidget(pCopyNewer, line, 0, 1, 2);
pCopyNewer->setToolTip(i18n(
"Don't look inside, just take the newer file.\n"
"Do not look inside, just take the newer file.\n"
"(Use this only if you know what you are doing!)\n"
"Only effective when comparing two directories."));
++line;
......@@ -1472,7 +1470,7 @@ void OptionDialog::setupRegionalPage(void)
"Disable this if different individual settings are needed."));
++line;
label = new QLabel(i18n("Note: Local Encoding is ") + "\"" + QTextCodec::codecForLocale()->name() + "\"", page);
label = new QLabel(i18n("Note: Local Encoding is \"%1\"", QLatin1String(QTextCodec::codecForLocale()->name())), page);
gbox->addWidget(label, line, 0);
++line;
......
......@@ -799,8 +799,8 @@ void KDiff3App::slotFinishMainInit()
if(bVisibleMergeResultWindow && (!m_sd1.isText() || !m_sd2.isText() || !m_sd3.isText()))
{
KMessageBox::information(this, i18n(
"Some inputfiles don't seem to be pure textfiles.\n"
"Note that the KDiff3-merge was not meant for binary data.\n"
"Some input files do not seem to be pure text files.\n"
"Note that the KDiff3 merge was not meant for binary data.\n"
"Continue at your own risk."));
}
if(m_sd1.isIncompleteConversion() || m_sd2.isIncompleteConversion() || m_sd3.isIncompleteConversion())
......@@ -815,9 +815,8 @@ void KDiff3App::slotFinishMainInit()
KMessageBox::information(this, i18n("Some input characters could not be converted to valid unicode.\n"
"You might be using the wrong codec. (e.g. UTF-8 for non UTF-8 files).\n"
"Don't save the result if unsure. Continue at your own risk.\n"
"Affected input files are in %1.")
.arg(files));
"Do not save the result if unsure. Continue at your own risk.\n"
"Affected input files are in %1.", files));
}
}
......@@ -1921,7 +1920,7 @@ bool KDiff3App::canContinue()
if(m_bOutputModified)
{
int result = KMessageBox::warningYesNoCancel(this,
i18n("The merge result hasn't been saved."),
i18n("The merge result has not been saved."),
i18n("Warning"),
KGuiItem(i18n("Save && Continue")),
KGuiItem(i18n("Continue Without Saving")));
......
......@@ -115,7 +115,7 @@ OpenDialog::OpenDialog(
QHBoxLayout* hl = new QHBoxLayout();
h->addLayout(hl, 3, 1);
hl->addStretch(2);
button = new QPushButton(i18n("Swap/Copy Names ..."), this);
button = new QPushButton(i18n("Swap/Copy Names..."), this);
//button->setToggleButton(false);
hl->addWidget(button);
......
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