From 7fbae445277374fb2bacfcd7c04e8d7fbb2c3f05 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Thu, 23 Nov 2006 13:10:00 +0000 Subject: [PATCH] Fix i18n svn path=/trunk/playground/utils/dolphin/; revision=607156 --- src/dolphin.cpp | 16 ++++++++-------- src/dolphinview.cpp | 20 ++++++++++---------- src/infosidebarpage.cpp | 2 +- src/itemeffectsmanager.cpp | 2 +- src/renamedialog.cpp | 2 +- src/statusbarspaceinfo.cpp | 4 +--- src/undomanager.cpp | 10 +++++----- src/urlnavigator.cpp | 4 ++-- 8 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/dolphin.cpp b/src/dolphin.cpp index 2e7efec6f..b3991531b 100644 --- a/src/dolphin.cpp +++ b/src/dolphin.cpp @@ -396,7 +396,7 @@ void Dolphin::createFolder() // TODO: provide message type hint if (ok) { - statusBar->setMessage(i18n("Created folder %1.").arg(url.path()), + statusBar->setMessage(i18n("Created folder %1.",url.path()), DolphinStatusBar::OperationCompleted); DolphinCommand command(DolphinCommand::CreateFolder, KUrl::List(), url); @@ -406,11 +406,11 @@ void Dolphin::createFolder() // Creating of the folder has been failed. Check whether the creating // has been failed because a folder with the same name exists... if (KIO::NetAccess::exists(url, true, this)) { - statusBar->setMessage(i18n("A folder named %1 already exists.").arg(url.path()), + statusBar->setMessage(i18n("A folder named %1 already exists.",url.path()), DolphinStatusBar::Error); } else { - statusBar->setMessage(i18n("Creating of folder %1 failed.").arg(url.path()), + statusBar->setMessage(i18n("Creating of folder %1 failed.",url.path()), DolphinStatusBar::Error); } @@ -491,7 +491,7 @@ void Dolphin::createFile() const QString destPath(viewUrl.pathOrUrl() + "/" + KIO::encodeFileName(name)); const KUrl destUrl(destPath); if (KIO::NetAccess::exists(destUrl, false, this)) { - statusBar->setMessage(i18n("A file named %1 already exists.").arg(name), + statusBar->setMessage(i18n("A file named %1 already exists.",name), DolphinStatusBar::Error); return; } @@ -501,7 +501,7 @@ void Dolphin::createFile() KIO::CopyJob* job = KIO::copyAs(sourceUrl, destUrl); job->setDefaultPermissions(true); if (KIO::NetAccess::synchronousRun(job, this)) { - statusBar->setMessage(i18n("Created file %1.").arg(name), + statusBar->setMessage(i18n("Created file %1.",name), DolphinStatusBar::OperationCompleted); KUrl::List list; @@ -511,7 +511,7 @@ void Dolphin::createFile() } else { - statusBar->setMessage(i18n("Creating of file %1 failed.").arg(name), + statusBar->setMessage(i18n("Creating of file %1 failed.",name), DolphinStatusBar::Error); } } @@ -540,11 +540,11 @@ void Dolphin::deleteItems() QString text; if (itemCount > 1) { - text = i18n("Do you really want to delete the %1 selected items?").arg(itemCount); + text = i18n("Do you really want to delete the %1 selected items?",itemCount); } else { const KUrl& url = list.first(); - text = i18n("Do you really want to delete '%1'?").arg(url.fileName()); + text = i18n("Do you really want to delete '%1'?",url.fileName()); } const bool del = KMessageBox::warningContinueCancel(this, diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index cab413b95..bcf17a620 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -255,7 +255,7 @@ void DolphinView::renameSelectedItems() if (destExists) { delete progressIndicator; progressIndicator = 0; - view->statusBar()->setMessage(i18n("Renaming failed (item '%1' already exists).").arg(name), + view->statusBar()->setMessage(i18n("Renaming failed (item '%1' already exists).",name), DolphinStatusBar::Error); break; } @@ -578,14 +578,14 @@ void DolphinView::rename(const KUrl& source, const QString& newName) } if (ok) { - m_statusBar->setMessage(i18n("Renamed file '%1' to '%2'.").arg(source.fileName(), dest.fileName()), + m_statusBar->setMessage(i18n("Renamed file '%1' to '%2'.",source.fileName(), dest.fileName()), DolphinStatusBar::OperationCompleted); DolphinCommand command(DolphinCommand::Rename, source, dest); UndoManager::instance().addCommand(command); } else { - m_statusBar->setMessage(i18n("Renaming of file '%1' to '%2' failed.").arg(source.fileName(), dest.fileName()), + m_statusBar->setMessage(i18n("Renaming of file '%1' to '%2' failed.",source.fileName(), dest.fileName()), DolphinStatusBar::Error); reload(); } @@ -915,7 +915,7 @@ void DolphinView::startDirLister(const KUrl& url, bool reload) m_statusBar->setMessage(i18n("The location is empty."), DolphinStatusBar::Error); } else { - m_statusBar->setMessage(i18n("The location '%1' is invalid.").arg(location), + m_statusBar->setMessage(i18n("The location '%1' is invalid.",location), DolphinStatusBar::Error); } return; @@ -948,7 +948,7 @@ QString DolphinView::defaultStatusBarText() const text = i18n("1 Item"); } else { - text = i18n("%1 Items").arg(itemCount); + text = i18n("%1 Items",itemCount); } text += " ("; @@ -957,7 +957,7 @@ QString DolphinView::defaultStatusBarText() const text += i18n("1 Folder"); } else { - text += i18n("%1 Folders").arg(m_folderCount); + text += i18n("%1 Folders",m_folderCount); } text += ", "; @@ -966,7 +966,7 @@ QString DolphinView::defaultStatusBarText() const text += i18n("1 File"); } else { - text += i18n("%1 Files").arg(m_fileCount); + text += i18n("%1 Files",m_fileCount); } text += ")"; @@ -1003,7 +1003,7 @@ QString DolphinView::selectionStatusBarText() const text = i18n("1 Folder selected"); } else if (folderCount > 1) { - text = i18n("%1 Folders selected").arg(folderCount); + text = i18n("%1 Folders selected",folderCount); } if ((fileCount > 0) && (folderCount > 0)) { @@ -1012,10 +1012,10 @@ QString DolphinView::selectionStatusBarText() const const QString sizeText(KIO::convertSize(byteSize)); if (fileCount == 1) { - text += i18n("1 File selected (%1)").arg(sizeText); + text += i18n("1 File selected (%1)",sizeText); } else if (fileCount > 1) { - text += i18n("%1 Files selected (%1)").arg(fileCount).arg(sizeText); + text += i18n("%1 Files selected (%1)",fileCount,sizeText); } return text; diff --git a/src/infosidebarpage.cpp b/src/infosidebarpage.cpp index 017fcb9f6..bf3d5f4fc 100644 --- a/src/infosidebarpage.cpp +++ b/src/infosidebarpage.cpp @@ -165,7 +165,7 @@ void InfoSidebarPage::showItemInfo() K3Icon::NoGroup, K3Icon::SizeEnormous); m_preview->setPixmap(icon); - m_name->setText(i18n("%1 items selected").arg(selectedItems->count())); + m_name->setText(i18n("%1 items selected",selectedItems->count())); } else if (!applyBookmark()) { // try to get a preview pixmap from the item... diff --git a/src/itemeffectsmanager.cpp b/src/itemeffectsmanager.cpp index bfc4d33bb..782dfe3c5 100644 --- a/src/itemeffectsmanager.cpp +++ b/src/itemeffectsmanager.cpp @@ -182,7 +182,7 @@ QString ItemEffectsManager::statusBarText(KFileItem* fileInfo) const // KFileItem::getStatusBar() returns "MyDocuments/ Folder" as // status bar text for a folder 'MyDocuments'. This is adjusted // to "MyDocuments (Folder)" in Dolphin. - return i18n("%1 (Folder)").arg(fileInfo->name()); + return i18n("%1 (Folder)",fileInfo->name()); } return fileInfo->getStatusBarInfo(); diff --git a/src/renamedialog.cpp b/src/renamedialog.cpp index 882db8b66..02238e5e7 100644 --- a/src/renamedialog.cpp +++ b/src/renamedialog.cpp @@ -44,7 +44,7 @@ RenameDialog::RenameDialog(const KUrl::List& items) : topLayout->setMargin(KDialog::marginHint()); const int itemCount = items.count(); - QLabel* editLabel = new QLabel(i18n("Rename the %1 selected items to:").arg(itemCount), + QLabel* editLabel = new QLabel(i18n("Rename the %1 selected items to:",itemCount), page); m_lineEdit = new KLineEdit(page); diff --git a/src/statusbarspaceinfo.cpp b/src/statusbarspaceinfo.cpp index 3c6073ca5..0b2c4d133 100644 --- a/src/statusbarspaceinfo.cpp +++ b/src/statusbarspaceinfo.cpp @@ -91,9 +91,7 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */) } painter.drawRect(QRect(left, barTop + 2, right, barHeight - 2)); - text = i18n("%1% of %2 used") - .arg( 100 - (int)(100.0 * m_kBAvailable / m_kBSize)) - .arg(KIO::convertSizeFromKiB(m_kBSize)); + text = i18n("%1% of %2 used", QString::number(100 - (int)(100.0 * m_kBAvailable / m_kBSize)), KIO::convertSizeFromKiB(m_kBSize)); } else { if (m_gettingSize) { diff --git a/src/undomanager.cpp b/src/undomanager.cpp index 62a7ff0b9..d4a4574a0 100644 --- a/src/undomanager.cpp +++ b/src/undomanager.cpp @@ -84,7 +84,7 @@ void UndoManager::addCommand(const DolphinCommand& command) } emit undoAvailable(true); - emit undoTextChanged(i18n("Undo: %1").arg(commandText(command))); + emit undoTextChanged(i18n("Undo: %1",commandText(command))); // prevent an endless growing of the Undo history if (m_historyIndex > 10000) { @@ -132,12 +132,12 @@ void UndoManager::undo() emit undoTextChanged(i18n("Undo")); } else { - emit undoTextChanged(i18n("Undo: %1").arg(commandText(m_history[m_historyIndex]))); + emit undoTextChanged(i18n("Undo: %1",commandText(m_history[m_historyIndex]))); } if (m_historyIndex < static_cast(m_history.count()) - 1) { emit redoAvailable(true); - emit redoTextChanged(i18n("Redo: %1").arg(commandText(command))); + emit redoTextChanged(i18n("Redo: %1",commandText(command))); } else { emit redoAvailable(false); @@ -244,11 +244,11 @@ void UndoManager::redo() emit redoTextChanged(i18n("Redo")); } else { - emit redoTextChanged(i18n("Redo: %1").arg(commandText(m_history[m_historyIndex + 1]))); + emit redoTextChanged(i18n("Redo: %1",commandText(m_history[m_historyIndex + 1]))); } emit undoAvailable(true); - emit undoTextChanged(i18n("Undo: %1").arg(commandText(command))); + emit undoTextChanged(i18n("Undo: %1",commandText(command))); Dolphin& dolphin = Dolphin::mainWin(); diff --git a/src/urlnavigator.cpp b/src/urlnavigator.cpp index f81a20218..1f9295cb5 100644 --- a/src/urlnavigator.cpp +++ b/src/urlnavigator.cpp @@ -478,14 +478,14 @@ void UrlNavigator::updateContent() delete m_protocolSeparator; m_protocolSeparator = 0; delete m_host; m_host = 0; - QToolTip::add(m_toggleButton, i18n("Browse (%1, Escape)").arg(shortcut)); + QToolTip::add(m_toggleButton, i18n("Browse (%1, Escape)",shortcut)); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); m_pathBox->show(); m_pathBox->setUrl(url()); } else { - QToolTip::add(m_toggleButton, i18n("Edit location (%1)").arg(shortcut)); + QToolTip::add(m_toggleButton, i18n("Edit location (%1)",shortcut)); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); m_pathBox->hide(); -- 2.47.3