mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
i18n: tr() and avoid string puzzle
This commit is contained in:
@@ -676,12 +676,12 @@ Servent::checkACL( const Connection* conn, const QString &nodeid, bool showDialo
|
|||||||
qDebug() << "ACL for this node not found";
|
qDebug() << "ACL for this node not found";
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setIcon( QMessageBox::Question );
|
msgBox.setIcon( QMessageBox::Question );
|
||||||
msgBox.setText( "Incoming Connection Attempt" );
|
msgBox.setText( tr( "Incoming Connection Attempt" ) );
|
||||||
msgBox.setInformativeText( QString( "Another Tomahawk instance is attempting to connect to you. Select whether to allow or deny this connection.\n\nPeer name: %1\nPeer ID: %2\n\nRemember: Only allow peers to connect if you have the legal right for them to stream music from you.").arg( conn->name(), nodeid ) );
|
msgBox.setInformativeText( tr( "Another Tomahawk instance is attempting to connect to you. Select whether to allow or deny this connection.\n\nPeer name: %1\nPeer ID: %2\n\nRemember: Only allow peers to connect if you have the legal right for them to stream music from you.").arg( conn->name(), nodeid ) );
|
||||||
QPushButton *denyButton = msgBox.addButton( "Deny", QMessageBox::HelpRole );
|
QPushButton *denyButton = msgBox.addButton( tr( "Deny" ), QMessageBox::HelpRole );
|
||||||
QPushButton *alwaysDenyButton = msgBox.addButton( "Always Deny", QMessageBox::YesRole );
|
QPushButton *alwaysDenyButton = msgBox.addButton( tr( "Always Deny" ), QMessageBox::YesRole );
|
||||||
QPushButton *allowButton = msgBox.addButton( "Allow", QMessageBox::NoRole );
|
QPushButton *allowButton = msgBox.addButton( tr( "Allow" ), QMessageBox::NoRole );
|
||||||
QPushButton *alwaysAllowButton = msgBox.addButton( "Always Allow", QMessageBox::ActionRole );
|
QPushButton *alwaysAllowButton = msgBox.addButton( tr( "Always Allow" ), QMessageBox::ActionRole );
|
||||||
|
|
||||||
msgBox.setDefaultButton( denyButton );
|
msgBox.setDefaultButton( denyButton );
|
||||||
msgBox.setEscapeButton( denyButton );
|
msgBox.setEscapeButton( denyButton );
|
||||||
|
@@ -120,7 +120,7 @@ JabberPlugin::onConnected()
|
|||||||
{
|
{
|
||||||
if ( !m_menu )
|
if ( !m_menu )
|
||||||
{
|
{
|
||||||
m_menu = new QMenu( QString( "Jabber (" ).append( accountName() ).append( ")" ) );
|
m_menu = new QMenu( tr( "Jabber (%1)" ).arg( accountName() ) );
|
||||||
m_addFriendAction = m_menu->addAction( tr( "Add Friend..." ) );
|
m_addFriendAction = m_menu->addAction( tr( "Add Friend..." ) );
|
||||||
|
|
||||||
connect( m_addFriendAction, SIGNAL( triggered() ), SLOT( showAddFriendDialog() ) ) ;
|
connect( m_addFriendAction, SIGNAL( triggered() ), SLOT( showAddFriendDialog() ) ) ;
|
||||||
|
@@ -87,7 +87,7 @@ TwitterPlugin::name()
|
|||||||
const QString
|
const QString
|
||||||
TwitterPlugin::friendlyName()
|
TwitterPlugin::friendlyName()
|
||||||
{
|
{
|
||||||
return QString("Twitter");
|
return tr("Twitter");
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString
|
const QString
|
||||||
|
@@ -51,8 +51,8 @@ TwitterConfigWidget::TwitterConfigWidget( SipPlugin* plugin, QWidget *parent ) :
|
|||||||
TomahawkSettings* s = TomahawkSettings::instance();
|
TomahawkSettings* s = TomahawkSettings::instance();
|
||||||
if ( s->twitterOAuthToken().isEmpty() || s->twitterOAuthTokenSecret().isEmpty() || s->twitterScreenName().isEmpty() )
|
if ( s->twitterOAuthToken().isEmpty() || s->twitterOAuthTokenSecret().isEmpty() || s->twitterScreenName().isEmpty() )
|
||||||
{
|
{
|
||||||
ui->twitterStatusLabel->setText("Status: No saved credentials");
|
ui->twitterStatusLabel->setText( tr( "Status: No saved credentials" ) );
|
||||||
ui->twitterAuthenticateButton->setText( "Authenticate" );
|
ui->twitterAuthenticateButton->setText( tr( "Authenticate" ) );
|
||||||
ui->twitterInstructionsInfoLabel->setVisible( false );
|
ui->twitterInstructionsInfoLabel->setVisible( false );
|
||||||
ui->twitterGlobalTweetLabel->setVisible( false );
|
ui->twitterGlobalTweetLabel->setVisible( false );
|
||||||
ui->twitterTweetGotTomahawkButton->setVisible( false );
|
ui->twitterTweetGotTomahawkButton->setVisible( false );
|
||||||
@@ -63,8 +63,8 @@ TwitterConfigWidget::TwitterConfigWidget( SipPlugin* plugin, QWidget *parent ) :
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->twitterStatusLabel->setText("Status: Credentials saved for " + s->twitterScreenName() );
|
ui->twitterStatusLabel->setText( tr( "Status: Credentials saved for %1" ).arg( s->twitterScreenName() ) );
|
||||||
ui->twitterAuthenticateButton->setText( "De-authenticate" );
|
ui->twitterAuthenticateButton->setText( tr( "De-authenticate" ) );
|
||||||
ui->twitterInstructionsInfoLabel->setVisible( true );
|
ui->twitterInstructionsInfoLabel->setVisible( true );
|
||||||
ui->twitterGlobalTweetLabel->setVisible( true );
|
ui->twitterGlobalTweetLabel->setVisible( true );
|
||||||
ui->twitterTweetGotTomahawkButton->setVisible( true );
|
ui->twitterTweetGotTomahawkButton->setVisible( true );
|
||||||
@@ -84,7 +84,7 @@ TwitterConfigWidget::~TwitterConfigWidget()
|
|||||||
void
|
void
|
||||||
TwitterConfigWidget::authDeauthTwitter()
|
TwitterConfigWidget::authDeauthTwitter()
|
||||||
{
|
{
|
||||||
if ( ui->twitterAuthenticateButton->text() == "Authenticate" )
|
if ( ui->twitterAuthenticateButton->text() == tr( "Authenticate" ) ) //FIXME: don't rely on UI strings here!
|
||||||
authenticateTwitter();
|
authenticateTwitter();
|
||||||
else
|
else
|
||||||
deauthenticateTwitter();
|
deauthenticateTwitter();
|
||||||
@@ -114,7 +114,7 @@ TwitterConfigWidget::authenticateVerifyReply( const QTweetUser &user )
|
|||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
if ( user.id() == 0 )
|
if ( user.id() == 0 )
|
||||||
{
|
{
|
||||||
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("The credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("The credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
||||||
emit twitterAuthed( false );
|
emit twitterAuthed( false );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -124,8 +124,8 @@ TwitterConfigWidget::authenticateVerifyReply( const QTweetUser &user )
|
|||||||
s->setTwitterCachedFriendsSinceId( 0 );
|
s->setTwitterCachedFriendsSinceId( 0 );
|
||||||
s->setTwitterCachedMentionsSinceId( 0 );
|
s->setTwitterCachedMentionsSinceId( 0 );
|
||||||
|
|
||||||
ui->twitterStatusLabel->setText("Status: Credentials saved for " + s->twitterScreenName() );
|
ui->twitterStatusLabel->setText( tr( "Status: Credentials saved for %1" ).arg( s->twitterScreenName() ) );
|
||||||
ui->twitterAuthenticateButton->setText( "De-authenticate" );
|
ui->twitterAuthenticateButton->setText( tr( "De-authenticate" ) );
|
||||||
ui->twitterInstructionsInfoLabel->setVisible( true );
|
ui->twitterInstructionsInfoLabel->setVisible( true );
|
||||||
ui->twitterGlobalTweetLabel->setVisible( true );
|
ui->twitterGlobalTweetLabel->setVisible( true );
|
||||||
ui->twitterTweetGotTomahawkButton->setVisible( true );
|
ui->twitterTweetGotTomahawkButton->setVisible( true );
|
||||||
@@ -142,7 +142,7 @@ TwitterConfigWidget::authenticateVerifyError( QTweetNetBase::ErrorCode code, con
|
|||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
qDebug() << "Error validating credentials, error code is " << code << ", error message is " << errorMsg;
|
qDebug() << "Error validating credentials, error code is " << code << ", error message is " << errorMsg;
|
||||||
ui->twitterStatusLabel->setText("Status: Error validating credentials");
|
ui->twitterStatusLabel->setText(tr("Status: Error validating credentials"));
|
||||||
emit twitterAuthed( false );
|
emit twitterAuthed( false );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -156,8 +156,8 @@ TwitterConfigWidget::deauthenticateTwitter()
|
|||||||
s->setTwitterOAuthTokenSecret( QString() );
|
s->setTwitterOAuthTokenSecret( QString() );
|
||||||
s->setTwitterScreenName( QString() );
|
s->setTwitterScreenName( QString() );
|
||||||
|
|
||||||
ui->twitterStatusLabel->setText("Status: No saved credentials");
|
ui->twitterStatusLabel->setText(tr("Status: No saved credentials"));
|
||||||
ui->twitterAuthenticateButton->setText( "Authenticate" );
|
ui->twitterAuthenticateButton->setText( tr( "Authenticate" ) );
|
||||||
ui->twitterInstructionsInfoLabel->setVisible( false );
|
ui->twitterInstructionsInfoLabel->setVisible( false );
|
||||||
ui->twitterGlobalTweetLabel->setVisible( false );
|
ui->twitterGlobalTweetLabel->setVisible( false );
|
||||||
ui->twitterTweetGotTomahawkButton->setVisible( false );
|
ui->twitterTweetGotTomahawkButton->setVisible( false );
|
||||||
@@ -170,7 +170,7 @@ TwitterConfigWidget::deauthenticateTwitter()
|
|||||||
void
|
void
|
||||||
TwitterConfigWidget::tweetComboBoxIndexChanged( int index )
|
TwitterConfigWidget::tweetComboBoxIndexChanged( int index )
|
||||||
{
|
{
|
||||||
if( ui->twitterTweetComboBox->currentText() == "Global Tweet" )
|
if( ui->twitterTweetComboBox->currentText() == tr( "Global Tweet" ) ) //FIXME: use data!
|
||||||
{
|
{
|
||||||
ui->twitterUserTweetLineEdit->setReadOnly( true );
|
ui->twitterUserTweetLineEdit->setReadOnly( true );
|
||||||
ui->twitterUserTweetLineEdit->setEnabled( false );
|
ui->twitterUserTweetLineEdit->setEnabled( false );
|
||||||
@@ -181,10 +181,10 @@ TwitterConfigWidget::tweetComboBoxIndexChanged( int index )
|
|||||||
ui->twitterUserTweetLineEdit->setEnabled( true );
|
ui->twitterUserTweetLineEdit->setEnabled( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ui->twitterTweetComboBox->currentText() == "Direct Message" )
|
if( ui->twitterTweetComboBox->currentText() == tr( "Direct Message" ) ) //FIXME: use data!
|
||||||
ui->twitterTweetGotTomahawkButton->setText( "Send Message!" );
|
ui->twitterTweetGotTomahawkButton->setText( tr( "Send Message!" ) );
|
||||||
else
|
else
|
||||||
ui->twitterTweetGotTomahawkButton->setText( "Tweet!" );
|
ui->twitterTweetGotTomahawkButton->setText( tr( "Tweet!" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -194,7 +194,7 @@ TwitterConfigWidget::startPostGotTomahawkStatus()
|
|||||||
|
|
||||||
if ( m_postGTtype != "Global Tweet" && ( ui->twitterUserTweetLineEdit->text().isEmpty() || ui->twitterUserTweetLineEdit->text() == "@" ) )
|
if ( m_postGTtype != "Global Tweet" && ( ui->twitterUserTweetLineEdit->text().isEmpty() || ui->twitterUserTweetLineEdit->text() == "@" ) )
|
||||||
{
|
{
|
||||||
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("You must enter a user name for this type of tweet.") );
|
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("You must enter a user name for this type of tweet.") );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ TwitterConfigWidget::startPostGotTomahawkStatus()
|
|||||||
TomahawkSettings* s = TomahawkSettings::instance();
|
TomahawkSettings* s = TomahawkSettings::instance();
|
||||||
if ( s->twitterOAuthToken().isEmpty() || s->twitterOAuthTokenSecret().isEmpty() || s->twitterScreenName().isEmpty() )
|
if ( s->twitterOAuthToken().isEmpty() || s->twitterOAuthTokenSecret().isEmpty() || s->twitterScreenName().isEmpty() )
|
||||||
{
|
{
|
||||||
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("Your saved credentials could not be loaded.\nYou may wish to try re-authenticating.") );
|
QMessageBox::critical( this, tr("Tweetin' Error"), tr("Your saved credentials could not be loaded.\nYou may wish to try re-authenticating.") );
|
||||||
emit twitterAuthed( false );
|
emit twitterAuthed( false );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ TwitterConfigWidget::postGotTomahawkStatusAuthVerifyReply( const QTweetUser &use
|
|||||||
{
|
{
|
||||||
if ( user.id() == 0 )
|
if ( user.id() == 0 )
|
||||||
{
|
{
|
||||||
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("Your saved credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("Your saved credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
||||||
emit twitterAuthed( false );
|
emit twitterAuthed( false );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -264,18 +264,18 @@ void
|
|||||||
TwitterConfigWidget::postGotTomahawkStatusUpdateReply( const QTweetStatus& status )
|
TwitterConfigWidget::postGotTomahawkStatusUpdateReply( const QTweetStatus& status )
|
||||||
{
|
{
|
||||||
if ( status.id() == 0 )
|
if ( status.id() == 0 )
|
||||||
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("There was an error posting your status -- sorry!") );
|
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("There was an error posting your status -- sorry!") );
|
||||||
else
|
else
|
||||||
QMessageBox::information( 0, QString("Tweeted!"), QString("Your tweet has been posted!") );
|
QMessageBox::information( 0, tr("Tweeted!"), tr("Your tweet has been posted!") );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TwitterConfigWidget::postGotTomahawkDirectMessageReply( const QTweetDMStatus& status )
|
TwitterConfigWidget::postGotTomahawkDirectMessageReply( const QTweetDMStatus& status )
|
||||||
{
|
{
|
||||||
if ( status.id() == 0 )
|
if ( status.id() == 0 )
|
||||||
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("There was an error posting your direct message -- sorry!") );
|
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("There was an error posting your direct message -- sorry!") );
|
||||||
else
|
else
|
||||||
QMessageBox::information( 0, QString("Tweeted!"), QString("Your message has been posted!") );
|
QMessageBox::information( 0, tr("Tweeted!"), tr("Your message has been posted!") );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -283,5 +283,5 @@ TwitterConfigWidget::postGotTomahawkStatusUpdateError( QTweetNetBase::ErrorCode
|
|||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
qDebug() << "Error posting Got Tomahawk message, error code is " << code << ", error message is " << errorMsg;
|
qDebug() << "Error posting Got Tomahawk message, error code is " << code << ", error message is " << errorMsg;
|
||||||
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("There was an error posting your status -- sorry!") );
|
QMessageBox::critical( 0, tr("Tweetin' Error"), tr("There was an error posting your status -- sorry!") );
|
||||||
}
|
}
|
||||||
|
@@ -306,9 +306,9 @@ void XMPPBot::infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType ty
|
|||||||
}
|
}
|
||||||
InfoGenericMap tmap = output.value<Tomahawk::InfoSystem::InfoGenericMap>();
|
InfoGenericMap tmap = output.value<Tomahawk::InfoSystem::InfoGenericMap>();
|
||||||
QString artist = input.toString();
|
QString artist = input.toString();
|
||||||
m_currReturnMessage += QString("\nTerms for %1:\n").arg(artist);
|
m_currReturnMessage += tr("\nTerms for %1:\n").arg(artist);
|
||||||
if (tmap.isEmpty())
|
if (tmap.isEmpty())
|
||||||
m_currReturnMessage += QString("No terms found, sorry.");
|
m_currReturnMessage += tr("No terms found, sorry.");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool first = true;
|
bool first = true;
|
||||||
@@ -341,7 +341,7 @@ void XMPPBot::infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType ty
|
|||||||
QString artist = input.toString();
|
QString artist = input.toString();
|
||||||
qreal retVal = output.toReal();
|
qreal retVal = output.toReal();
|
||||||
QString retValString = (retVal == 0.0 ? "(none)" : QString::number(retVal));
|
QString retValString = (retVal == 0.0 ? "(none)" : QString::number(retVal));
|
||||||
m_currReturnMessage += QString("\nHotttness for %1: %2\n").arg(artist).arg(retValString);
|
m_currReturnMessage += tr("\nHotttness for %1: %2\n").arg(artist, retValString);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case InfoArtistFamiliarity:
|
case InfoArtistFamiliarity:
|
||||||
@@ -357,7 +357,7 @@ void XMPPBot::infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType ty
|
|||||||
QString artist = input.toString();
|
QString artist = input.toString();
|
||||||
qreal retVal = output.toReal();
|
qreal retVal = output.toReal();
|
||||||
QString retValString = (retVal == 0.0 ? "(none)" : QString::number(retVal));
|
QString retValString = (retVal == 0.0 ? "(none)" : QString::number(retVal));
|
||||||
m_currReturnMessage += QString("\nFamiliartiy for %1: %2\n").arg(artist).arg(retValString);
|
m_currReturnMessage += tr("\nFamiliarity for %1: %2\n").arg(artist, retValString);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case InfoTrackLyrics:
|
case InfoTrackLyrics:
|
||||||
@@ -375,7 +375,7 @@ void XMPPBot::infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType ty
|
|||||||
QString track = inHash["trackName"].toString();
|
QString track = inHash["trackName"].toString();
|
||||||
QString lyrics = output.toString();
|
QString lyrics = output.toString();
|
||||||
qDebug() << "lyrics = " << lyrics;
|
qDebug() << "lyrics = " << lyrics;
|
||||||
m_currReturnMessage += QString("\nLyrics for \"%1\" by %2:\n\n%3\n").arg(track).arg(artist).arg(lyrics);
|
m_currReturnMessage += tr("\nLyrics for \"%1\" by %2:\n\n%3\n").arg(track, artist, lyrics);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user