Commit e3994658 authored by Pino Toscano's avatar Pino Toscano

make it compile with the new snapshot

port to the new i18n api

svn path=/branches/work/kde4/playground/graphics/okular/; revision=528345
parent e1a52ccd
......@@ -7,7 +7,7 @@
* (at your option) any later version. *
***************************************************************************/
#include "dlgaccessibilitybase.h"
#include "ui_dlgaccessibilitybase.h"
#include "dlgaccessibility.h"
......
......@@ -11,7 +11,7 @@
#include <config.h>
#include "dlggeneralbase.h"
#include "ui_dlggeneralbase.h"
#include "dlggeneral.h"
......
......@@ -10,7 +10,7 @@
#include <qfont.h>
#include <kiconloader.h>
#include "dlgperformancebase.h"
#include "ui_dlgperformancebase.h"
#include "dlgperformance.h"
......
......@@ -7,7 +7,7 @@
* (at your option) any later version. *
***************************************************************************/
#include "dlgpresentationbase.h"
#include "ui_dlgpresentationbase.h"
#include "dlgpresentation.h"
......
......@@ -11,7 +11,7 @@
#include <qlabel.h>
#include <klocale.h>
#include "chooseenginewidget.h"
#include "ui_chooseenginewidget.h"
#include "chooseenginedialog.h"
......@@ -26,7 +26,7 @@ ChooseEngineDialog::ChooseEngineDialog( const QStringList &generators, const QSt
m_widget->engineList->addItems(generators);
m_widget->description->setText(
i18n("More than one generator found for mimetype \"%1\", please select which one to use:").arg(mime)
i18n("More than one generator found for mimetype \"%1\", please select which one to use:", mime)
);
}
......
......@@ -915,7 +915,7 @@ bool KPDFDocument::searchText( int searchID, const QString & text, bool fromStar
}
}
else if ( !noDialogs )
KMessageBox::information( 0, i18n("No matches found for '%1'.").arg( text ) );
KMessageBox::information( 0, i18n( "No matches found for '%1'.", text ) );
}
// 3. PREVMATCH //TODO
else if ( type == PrevMatch )
......@@ -1137,7 +1137,7 @@ void KPDFDocument::processLink( const KPDFLink * link )
KRun::run( *ptr, lst );
}
else
KMessageBox::information( 0, i18n( "No application found for opening file of mimetype %1." ).arg( mime->name() ) );
KMessageBox::information( 0, i18n( "No application found for opening file of mimetype %1.", mime->name() ) );
} break;
case KPDFLink::Action: {
......
......@@ -30,7 +30,7 @@ QString KPDFLinkGoto::linkTip() const
QString KPDFLinkExecute::linkTip() const
{
return i18n( "Execute '%1'..." ).arg( m_fileName );
return i18n( "Execute '%1'...", m_fileName );
}
QString KPDFLinkBrowse::linkTip() const
......
......@@ -114,12 +114,12 @@ bool FaxRenderer::loadDocument( const QString & fileName, QVector< KPDFPage * >
QString temp;
if (fax.errorString().isEmpty())
{
temp=i18n("The specified file '%1' could not be opened.").arg(fileName);
temp=i18n("The specified file '%1' could not be opened.", fileName);
emit error (temp,-1);
}
else
{
temp=i18n("Error while opening file: %1.").arg(fax.errorString());
temp=i18n("Error while opening file: %1.", fax.errorString());
emit error (temp,-1);
}
// mutex.unlock();
......
......@@ -327,8 +327,8 @@ KFaxImage::notetiff()
break;
case 279: /* StripByteCounts */
if (count != nstrips) {
str = i18n("In file %1\nStripsPerImage tag 273=%2,tag279=%3\n")
.arg(filename()).arg(nstrips).arg(count);
str = i18n("In file %1\nStripsPerImage tag 273=%2,tag279=%3\n",
filename(), nstrips, count);
kfaxerror(str);
goto realbad;
}
......@@ -404,7 +404,7 @@ KFaxImage::notetiff()
void
KFaxImage::badfile(pagenode *pn)
{
kfaxerror(i18n("%1: Bad Fax File").arg(filename()));
kfaxerror(i18n("%1: Bad Fax File", filename()));
FreeImage(pn);
}
......
......@@ -336,8 +336,8 @@ const DocumentInfo * PDFGenerator::generateDocumentInfo()
docInfo.set( "mimeType", "application/pdf" );
if ( pdfdoc )
{
docInfo.set( "format", i18n( "PDF v. <version>", "PDF v. %1" )
.arg( QString::number( pdfdoc->getPDFVersion() ) ), i18n( "Format" ) );
docInfo.set( "format", i18n( "PDF v. <version>", "PDF v. %1",
QString::number( pdfdoc->getPDFVersion() ) ), i18n( "Format" ) );
docInfo.set( "encryption", pdfdoc->isEncrypted() ? i18n( "Encrypted" ) : i18n( "Unencrypted" ),
i18n("Security") );
docInfo.set( "optimization", pdfdoc->isLinearized() ? i18n( "Yes" ) : i18n( "No" ),
......
......@@ -551,7 +551,7 @@ bool Part::openURL(const KUrl &url)
if ( openOk )
m_viewportDirty = 0;
else
KMessageBox::error( widget(), i18n("Could not open %1").arg( url.prettyURL() ) );
KMessageBox::error( widget(), i18n( "Could not open %1", url.prettyURL() ) );
return openOk;
}
......@@ -803,12 +803,12 @@ void Part::slotSaveFileAs()
{
if ( KIO::NetAccess::exists( saveURL, false, widget() ) )
{
if (KMessageBox::warningContinueCancel( widget(), i18n("A file named \"%1\" already exists. Are you sure you want to overwrite it?").arg(saveURL.fileName()), QString::null, i18n("Overwrite")) != KMessageBox::Continue)
if (KMessageBox::warningContinueCancel( widget(), i18n("A file named \"%1\" already exists. Are you sure you want to overwrite it?", saveURL.fileName()), QString::null, i18n("Overwrite")) != KMessageBox::Continue)
return;
}
if ( !KIO::NetAccess::file_copy( url(), saveURL, -1, true ) )
KMessageBox::information( widget(), i18n("File could not be saved in '%1'. Try to save it to another location.").arg( saveURL.prettyURL() ) );
KMessageBox::information( widget(), i18n("File could not be saved in '%1'. Try to save it to another location.", saveURL.prettyURL() ) );
}
}
......
......@@ -296,7 +296,7 @@ bool Shell::handleCompressed(KUrl & url, const QString &path, const KMimeType::P
KMessageBox::detailedError( this,
i18n("<qt><strong>File Error!</strong> Could not open the file "
"<nobr><strong>%1</strong></nobr> for uncompression. "
"The file will not be loaded.</qt>").arg(path),
"The file will not be loaded.</qt>", path),
i18n("<qt>This error typically occurs if you do "
"not have enough permissions to read the file. "
"You can check ownership and permissions if you "
......@@ -323,7 +323,7 @@ bool Shell::handleCompressed(KUrl & url, const QString &path, const KMimeType::P
KMessageBox::detailedError(this,
i18n("<qt><strong>File Error!</strong> Could not uncompress "
"the file <nobr><strong>%1</strong></nobr>. "
"The file will not be loaded.</qt>").arg( path ),
"The file will not be loaded.</qt>", path ),
i18n("<qt>This error typically occurs if the file is corrupt. "
"If you want to be sure, try to decompress the file manually "
"using command-line tools.</qt>"));
......
......@@ -591,7 +591,7 @@ void NewStuffDialog::removeItem( AvailableItem * item )
d->itemsView->updateItem( item );
// inform the user ...
displayMessage( i18n("%1 is no more installed.").arg( item->name() ) );
displayMessage( i18n("%1 is no more installed.", item->name() ) );
// ... and any listening object
emit removedFile( item->name() );
......@@ -704,7 +704,7 @@ void NewStuffDialog::slotProvidersListResult( KIO::Job * job )
return;
}
else
displayMessage( i18n("Loaded %1 providers").arg( d->providers.count() ) );
displayMessage( i18n("Loaded %1 providers", d->providers.count() ) );
// update the providers ComboBox
for ( it = d->providers.begin(), iEnd = d->providers.end(); it != iEnd; ++it )
......@@ -747,7 +747,7 @@ void NewStuffDialog::slotLoadProvider( int pNumber )
d->providerJobs[ job ] = info;
// inform the user
displayMessage( i18n("Loading %1...").arg( provider->name() ) );
displayMessage( i18n( "Loading %1...", provider->name() ) );
// start the 'network watchdog timer'
d->networkTimer->start( 30*1000, true /*single shot*/ );
......@@ -811,7 +811,7 @@ void NewStuffDialog::slotProviderInfoResult( KIO::Job * job )
// update the control widget and inform user about the current operation
d->itemsView->setItems( itemList );
if ( itemList.count() )
displayMessage( i18n("There are %1 resources available.").arg( itemList.count() ) );
displayMessage( i18n("There are %1 resources available.", itemList.count() ) );
else
displayMessage( i18n("No resources available on this provider." ) );
}
......@@ -841,7 +841,7 @@ void NewStuffDialog::slotDownloadItem( AvailableItem * item )
d->itemsView->updateItem( item );
// inform the user
displayMessage( i18n("Installing '%1', this could take some time ...").arg( item->name() ) );
displayMessage( i18n( "Installing '%1', this could take some time ...", item->name() ) );
}
void NewStuffDialog::slotItemMessage( KIO::Job * job, const QString & message )
......@@ -881,7 +881,7 @@ void NewStuffDialog::slotItemResult( KIO::Job * job )
// error handling
if ( job->error() )
{
displayMessage( i18n("Network error while retrieving %1. Installation cancelled.").arg( item->name() ), Error );
displayMessage( i18n( "Network error while retrieving %1. Installation cancelled.", item->name() ), Error );
return;
}
......@@ -910,7 +910,7 @@ void NewStuffDialog::slotItemResult( KIO::Job * job )
*/
// inform the user ...
displayMessage( i18n("Installed! %1 is yours now.").arg( item->name() ), Info );
displayMessage( i18n( "Installed! %1 is yours now.", item->name() ), Info );
// ... and any listening object
emit installedFile( item->name(), item->category() );
......
......@@ -752,8 +752,8 @@ if (d->document->handleEvent( e ) )
d->typeAheadString = d->typeAheadString.left( d->typeAheadString.length() - 1 );
bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, true, false,
KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true );
QString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\".");
d->messageWindow->display( status.arg(d->typeAheadString.toLower()),
KLocalizedString status = found ? ki18n("Text found: \"%1\".") : ki18n("Text not found: \"%1\".");
d->messageWindow->display( status.subs(d->typeAheadString.toLower()).toString(),
found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 );
d->findTimeoutTimer->start( 3000, true );
}
......@@ -773,7 +773,7 @@ if (d->document->handleEvent( e ) )
// because it activates the accel
releaseKeyboard();
if ( d->document->continueSearch( PAGEVIEW_SEARCH_ID ) )
d->messageWindow->display( i18n("Text found: \"%1\".").arg(d->typeAheadString.toLower()),
d->messageWindow->display( i18n("Text found: \"%1\".", d->typeAheadString.toLower()),
PageViewMessage::Find, 3000 );
d->findTimeoutTimer->start( 3000, true );
// (2/4) it is needed to grab the keyboard becase people may have Space assigned
......@@ -792,8 +792,8 @@ if (d->document->handleEvent( e ) )
d->typeAheadString += e->text();
bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, false, false,
KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true );
QString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\".");
d->messageWindow->display( status.arg(d->typeAheadString.toLower()),
KLocalizedString status = found ? ki18n("Text found: \"%1\".") : ki18n("Text not found: \"%1\".");
d->messageWindow->display( status.subs(d->typeAheadString.toLower()).toString(),
found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 );
d->findTimeoutTimer->start( 3000, true );
}
......@@ -1334,7 +1334,7 @@ if (d->document->handleEvent( e ) )
if ( KpdfSettings::useKTTSD() )
speakText = menu.addAction( SmallIconSet("kttsd"), i18n( "Speak Text" ) );
}
menu.addTitle( i18n( "Image (%1 by %2 pixels)" ).arg( selectionRect.width() ).arg( selectionRect.height() ) );
menu.addTitle( i18n( "Image (%1 by %2 pixels)", selectionRect.width(), selectionRect.height() ) );
imageToClipboard = menu.addAction( QIcon(SmallIcon("image")), i18n( "Copy to Clipboard" ) );
imageToFile = menu.addAction( QIcon(SmallIcon("filesave")), i18n( "Save to File..." ) );
QAction *choice = menu.exec( e->globalPos() );
......@@ -1354,7 +1354,7 @@ if (d->document->handleEvent( e ) )
cb->setPixmap( copyPix, QClipboard::Clipboard );
if ( cb->supportsSelection() )
cb->setPixmap( copyPix, QClipboard::Selection );
d->messageWindow->display( i18n( "Image [%1x%2] copied to clipboard." ).arg( copyPix.width() ).arg( copyPix.height() ) );
d->messageWindow->display( i18n( "Image [%1x%2] copied to clipboard.", copyPix.width(), copyPix.height() ) );
}
else if ( choice == imageToFile )
{
......@@ -1371,7 +1371,7 @@ if (d->document->handleEvent( e ) )
else
type = mime->name();
copyPix.save( fileName, type.latin1() );
d->messageWindow->display( i18n( "Image [%1x%2] saved to %3 file." ).arg( copyPix.width() ).arg( copyPix.height() ).arg( type ) );
d->messageWindow->display( i18n( "Image [%1x%2] saved to %3 file.", copyPix.width(), copyPix.height() ).arg( type ) );
}
}
}
......@@ -1400,7 +1400,7 @@ if (d->document->handleEvent( e ) )
QString error;
if (KToolInvocation::startServiceByDesktopName("kttsd", QStringList(), &error))
{
d->messageWindow->display( i18n("Starting KTTSD Failed: %1").arg(error) );
d->messageWindow->display( i18n("Starting KTTSD Failed: %1", error) );
KpdfSettings::setUseKTTSD(false);
KpdfSettings::writeConfig();
}
......
......@@ -139,11 +139,11 @@ void PresentationWidget::notifySetup( const QVector< KPDFPage * > & pageSet, boo
if ( info )
{
if ( !info->get( "title" ).isNull() )
m_metaStrings += i18n( "Title: %1" ).arg( info->get( "title" ) );
m_metaStrings += i18n( "Title: %1", info->get( "title" ) );
if ( !info->get( "author" ).isNull() )
m_metaStrings += i18n( "Author: %1" ).arg( info->get( "author" ) );
m_metaStrings += i18n( "Author: %1", info->get( "author" ) );
}
m_metaStrings += i18n( "Pages: %1" ).arg( m_document->pages() );
m_metaStrings += i18n( "Pages: %1", m_document->pages() );
m_metaStrings += i18n( "Click to begin" );
}
......
......@@ -39,7 +39,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
// mime name based on mimetype id
QString mimeName = info->get( "mimeType" ).section( '/', -1 ).toUpper();
setCaption( i18n("%1 Properties").arg( mimeName ) );
setCaption( i18n( "%1 Properties", mimeName ) );
QDomElement docElement = info->documentElement();
......@@ -54,7 +54,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
continue;
// create labels and layout them
QLabel *key = new QLabel( i18n( "%1:" ).arg( titleString ), page );
QLabel *key = new QLabel( i18n( "%1:", titleString ), page );
QLabel *value = new KSqueezedTextLabel( valueString, page );
layout->addWidget( key, row, 0, Qt::AlignRight );
layout->addWidget( value, row, 1 );
......
......@@ -222,7 +222,7 @@ void Reviews::addContents( const KPDFPage * page )
Q3ListViewItem * pageItem = 0;
if ( KpdfSettings::groupByPage() )
{
QString pageText = i18n( "page %1" ).arg( page->number() + 1 );
QString pageText = i18n( "page %1", page->number() + 1 );
pageItem = new Q3ListViewItem( m_listView, pageText );
pageItem->setPixmap( 0, SmallIcon( "txt" ) );
pageItem->setOpen( KpdfSettings::groupByAuthor() );
......
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