Updated translations

This commit is contained in:
Stefan Persson 2013-05-23 11:39:27 +02:00
parent a231b56d57
commit 940d93556b
6 changed files with 117 additions and 38 deletions

View file

@ -85,7 +85,7 @@ void LiveObject::connectToServer() {
d->socket->abort();
PrivateData::Server server = d->serverList.takeFirst();
emit errorChanged("");
emit statusChanged("Connecting to server " + server.address);
emit statusChanged(tr("Connecting to server %1").arg(server.address));
d->socket->connectToHostEncrypted(server.address, server.port);
}
}
@ -115,7 +115,7 @@ void LiveObject::readyRead() {
} else if (msg->name() == "registered") {
d->registered = true;
emit registered(msg->argument(0));
emit errorChanged("Registered");
emit errorChanged(tr("Registered"));
} else if (msg->name() == "notregistered") {
LiveMessageToken token = msg->arg(0);
if (token.valueType != LiveMessageToken::Dictionary) {
@ -126,7 +126,7 @@ void LiveObject::readyRead() {
QSettings s;
s.setValue("Live/UUID", d->uuid);
emit notRegistered();
emit errorChanged("Not registered");
emit errorChanged(tr("Not registered"));
} else if (msg->name() == "command") {
if (msg->arg(0).valueType == LiveMessageToken::Dictionary && msg->arg(0).dictVal.contains("ACK")) {
int ack = msg->arg(0).dictVal["ACK"].intVal;
@ -142,7 +142,7 @@ void LiveObject::readyRead() {
void LiveObject::refreshServerList() {
emit errorChanged("");
emit statusChanged("Discover servers");
emit statusChanged(tr("Discover servers"));
d->serverList.clear();
QUrl url(TELLDUS_LIVE_URI);
QPair<QString, QString> version("protocolVersion", "2");
@ -199,7 +199,7 @@ void LiveObject::p_connected() {
this->sendMessage(msg);
emit errorChanged("");
emit statusChanged("Connected");
emit statusChanged(tr("Connected"));
emit connected();
}
@ -208,7 +208,7 @@ void LiveObject::p_disconnected() {
d->pongTimer.stop();
if (d->registered) {
//Clear the registered status
emit errorChanged("Disconnected from server");
emit errorChanged(tr("Disconnected from server"));
}
d->registered = false;
}
@ -221,9 +221,9 @@ void LiveObject::stateChanged( QAbstractSocket::SocketState socketState ) {
if (socketState == QAbstractSocket::UnconnectedState) {
int timeout = rand() % 40 + 10; //Random timeout from 10-50s to avoid flooding the servers
QTimer::singleShot(timeout*1000, this, SLOT(connectToServer()));
emit statusChanged("Reconnecting in " + QString::number(timeout) + " seconds...");
emit statusChanged(tr("Reconnecting in %1 seconds...").arg(QString::number(timeout)));
} else if (socketState == QAbstractSocket::ConnectingState) {
emit statusChanged("Connecting...");
emit statusChanged(tr("Connecting..."));
emit errorChanged("");
}
}
@ -237,7 +237,7 @@ void LiveObject::sslErrors( const QList<QSslError> & errors ) {
default:
//qDebug() << "SSL" << error.errorString();
everythingOK = false;
emit statusChanged("SSL Error");
emit statusChanged(tr("SSL Error"));
emit errorChanged(error.errorString());
break;
}
@ -252,7 +252,7 @@ void LiveObject::serverAssignReply( QNetworkReply *r ) {
if (r->error() != QNetworkReply::NoError) {
int timeout = rand() % 300 + 60; //Random timeout from 60s-6min to avoid flooding the servers
emit errorChanged(r->errorString());
emit statusChanged("Retrying in " + QString::number(timeout) + " seconds...");
emit statusChanged(tr("Retrying in %1 seconds...").arg(QString::number(timeout)));
QTimer::singleShot(timeout * 1000, this, SLOT(connectToServer()));
return;
}
@ -278,8 +278,8 @@ void LiveObject::serverAssignReply( QNetworkReply *r ) {
QTimer::singleShot(0, this, SLOT(connectToServer()));
} else {
int timeout = rand() % 300 + 60; //Random timeout from 60-6min to avoid flooding the servers
emit errorChanged("No servers found");
emit statusChanged("Retrying in " + QString::number(timeout) + " seconds...");
emit errorChanged(tr("No servers found"));
emit statusChanged(tr("Retrying in %1 seconds...").arg(QString::number(timeout)));
QTimer::singleShot(timeout * 1000, this, SLOT(connectToServer()));
}
}

View file

@ -1,28 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="sv_SE">
<context>
<name>Form</name>
<message>
<location filename="configuration.ui" line="20"/>
<source>Form</source>
<translation></translation>
</message>
<message>
<location filename="configuration.ui" line="37"/>
<source>Status:</source>
<translation>Status:</translation>
</message>
<message>
<location filename="configuration.ui" line="44"/>
<source>unknown</source>
<translation></translation>
</message>
<message>
<location filename="configuration.ui" line="64"/>
<source>Activate Telldus Live!</source>
<translation>Aktivera Telldus Live!</translation>
</message>
</context>
<context>
<name>LiveObject</name>
<message>
<location filename="LiveObject.cpp" line="68"/>
<location filename="LiveObject.cpp" line="71"/>
<source>Default browser could not be opened</source>
<translation>Standardwebbläsaren kunde inte öppnas</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="69"/>
<location filename="LiveObject.cpp" line="72"/>
<source>We could not open your default internet browser</source>
<translation>Vi kunde inte öppna din standardwebbläsare</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="70"/>
<location filename="LiveObject.cpp" line="73"/>
<source>Please copy the following url and enter it in your browser:&lt;br&gt;&lt;a href=&apos;%1&apos;&gt;%1&lt;/a&gt;</source>
<translation>Kopiera följande URL och klistra in i din webbläsare:&lt;br&gt;&lt;a href=&apos;%1&apos;&gt;%1&lt;/a&gt;</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="88"/>
<source>Connecting to server %1</source>
<translation>Ansluter till servern %1</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="118"/>
<source>Registered</source>
<translation>Registrerad</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="129"/>
<source>Not registered</source>
<translation>Inte registrerad</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="145"/>
<source>Discover servers</source>
<translation>Söker servrar</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="202"/>
<source>Connected</source>
<translation>Ansluten</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="211"/>
<source>Disconnected from server</source>
<translation>Bortkopplad från server</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="224"/>
<source>Reconnecting in %1 seconds...</source>
<translation>Återansluter om %1 sekunder...</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="226"/>
<source>Connecting...</source>
<translation>Ansluter...</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="240"/>
<source>SSL Error</source>
<translation>SSL-fel</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="255"/>
<location filename="LiveObject.cpp" line="282"/>
<source>Retrying in %1 seconds...</source>
<translation>Försöker igen om %1 sekunder...</translation>
</message>
<message>
<location filename="LiveObject.cpp" line="281"/>
<source>No servers found</source>
<translation>Inga servrar kunde hittas</translation>
</message>
</context>
<context>
<name>__init__</name>
<message>
<location filename="__init__.js" line="28"/>
<location filename="__init__.js" line="30"/>
<source>Activate Telldus Live!</source>
<translation>Aktivera Telldus Live!</translation>
</message>

View file

@ -53,7 +53,7 @@ IF(Plugin_PATH)
#Add all extra files
FOREACH(_FILE ${Plugin_EXTRA})
GET_FILENAME_COMPONENT(ext "${CMAKE_CURRENT_SOURCE_DIR}/${_FILE}" EXT)
IF (ext STREQUAL ".qml")
IF (ext STREQUAL ".qml" OR ext STREQUAL ".ui")
LIST(APPEND translation_sources "${CMAKE_CURRENT_SOURCE_DIR}/${_FILE}")
ENDIF ()
LIST(APPEND Plugin_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${_FILE}")

View file

@ -24,33 +24,33 @@
<translation>&amp;Avsluta</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="95"/>
<location filename="mainwindow.cpp" line="96"/>
<source>&amp;Help</source>
<translation>&amp;Hjälp</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="97"/>
<location filename="mainwindow.cpp" line="98"/>
<source>About &amp;Qt</source>
<translation>Om &amp;Qt</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="99"/>
<location filename="mainwindow.cpp" line="100"/>
<source>About &amp;TelldusCenter</source>
<translation>Om &amp;TelldusCenter</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="106"/>
<location filename="mainwindow.cpp" line="107"/>
<source>Pages</source>
<translation>Sidor</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="135"/>
<location filename="mainwindow.cpp" line="136"/>
<source>About TelldusCenter</source>
<translation>Om TelldusCenter</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="136"/>
<source>&lt;center&gt;&lt;img src=&apos;:/images/TelldusCenter_128.png&apos; width=128 height=128 /&gt;&lt;h2&gt;TelldusCenter %1&lt;/h2&gt;&lt;p&gt;Copyright &amp;copy; 2011 Telldus Technologies AB&lt;p&gt;&lt;/center&gt;</source>
<location filename="mainwindow.cpp" line="137"/>
<source>&lt;center&gt;&lt;img src=&apos;:/images/TelldusCenter_128.png&apos; width=128 height=128 /&gt;&lt;h2&gt;TelldusCenter %1&lt;/h2&gt;&lt;p&gt;Copyright &amp;copy; 2013 Telldus Technologies AB&lt;p&gt;&lt;/center&gt;</source>
<translation></translation>
</message>
</context>

View file

@ -135,7 +135,7 @@ void MainWindow::addWidget( const QString &page, const QIcon &icon, QWidget *wid
void MainWindow::slotAboutApplication() {
QMessageBox::about(this, tr("About TelldusCenter"),
tr("<center><img src=':/images/TelldusCenter_128.png' width=128 height=128 /><h2>TelldusCenter %1</h2>"
"<p>Copyright &copy; 2011 Telldus Technologies AB<p></center>").arg(VERSION_STRING(VERSION)));
"<p>Copyright &copy; 2013 Telldus Technologies AB<p></center>").arg(VERSION_STRING(VERSION)));
}
void MainWindow::slotConfigure() {

View file

@ -171,37 +171,37 @@
<context>
<name>DeviceWidget</name>
<message>
<location filename="devicewidget.cpp" line="40"/>
<location filename="devicewidget.cpp" line="44"/>
<source>New device...</source>
<translation>Ny enhet...</translation>
</message>
<message>
<location filename="devicewidget.cpp" line="42"/>
<location filename="devicewidget.cpp" line="46"/>
<source>New group...</source>
<translation>Ny grupp...</translation>
</message>
<message>
<location filename="devicewidget.cpp" line="46"/>
<location filename="devicewidget.cpp" line="50"/>
<source>New</source>
<translation>Ny</translation>
</message>
<message>
<location filename="devicewidget.cpp" line="56"/>
<location filename="devicewidget.cpp" line="60"/>
<source>Edit</source>
<translation>Redigera</translation>
</message>
<message>
<location filename="devicewidget.cpp" line="64"/>
<location filename="devicewidget.cpp" line="68"/>
<source>Remove</source>
<translation>Ta bort</translation>
</message>
<message>
<location filename="devicewidget.cpp" line="131"/>
<location filename="devicewidget.cpp" line="135"/>
<source>Are you sure you want to remove the selected device?</source>
<translation>Är du säker att du vill ta bort vald enhet?</translation>
</message>
<message>
<location filename="devicewidget.cpp" line="132"/>
<location filename="devicewidget.cpp" line="136"/>
<source>The device will be removed permanently from this application as well as all other applications.</source>
<translation>Enheten kommer tas bort permanent från både detta program såväl som alla andra program.</translation>
</message>
@ -240,32 +240,32 @@
<translation>Adresskod</translation>
</message>
<message>
<location filename="editdevicedialog.cpp" line="216"/>
<location filename="editdevicedialog.cpp" line="241"/>
<source>Please press a button on your remote</source>
<translation>Tryck en knapp din fjärrkontroll</translation>
</message>
<message>
<location filename="editdevicedialog.cpp" line="223"/>
<location filename="editdevicedialog.cpp" line="248"/>
<source>If you have a TellStick Duo connected,&lt;br&gt;you can use it to scan the code of the remote control</source>
<translation>Om du har en TellStick Duo ansluten,&lt;br&gt;kan du använda den för att hitta rätt enhet och inställningar</translation>
</message>
<message>
<location filename="editdevicedialog.cpp" line="235"/>
<location filename="editdevicedialog.cpp" line="260"/>
<source>You must choose a device</source>
<translation>Du måste välja en enhet</translation>
</message>
<message>
<location filename="editdevicedialog.cpp" line="236"/>
<location filename="editdevicedialog.cpp" line="261"/>
<source>Please select the device you have.</source>
<translation>Välj den enhet du har.</translation>
</message>
<message>
<location filename="editdevicedialog.cpp" line="252"/>
<location filename="editdevicedialog.cpp" line="277"/>
<source>The device must have a name.</source>
<translation>Enheten måste ha ett namn.</translation>
</message>
<message>
<location filename="editdevicedialog.cpp" line="253"/>
<location filename="editdevicedialog.cpp" line="278"/>
<source>Please fill in a name in the field under &apos;Name&apos;</source>
<translation>Skriv in ett namn i fältet &apos;Namn&apos;</translation>
</message>