Browse Source

Improve Web Ui translation

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
e170d9c3a8
  1. 3
      src/iconprovider.cpp
  2. 2
      src/preferences/options.ui
  3. 2
      src/webui/html/confirmdeletion.html
  4. 12
      src/webui/html/index.html
  5. 4
      src/webui/html/preferences_content.html
  6. 2
      src/webui/html/prop-general.html
  7. 2
      src/webui/html/properties.html
  8. 4
      src/webui/httpconnection.cpp
  9. 2
      src/webui/httpserver.cpp

3
src/iconprovider.cpp

@ -90,14 +90,11 @@ QIcon IconProvider::generateDifferentSizes(const QIcon &icon)
if(pixoff.height() > size.height()) if(pixoff.height() > size.height())
pixoff = pixoff.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); pixoff = pixoff.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
new_icon.addPixmap(pixoff, mode, QIcon::Off); new_icon.addPixmap(pixoff, mode, QIcon::Off);
Q_ASSERT(pixoff.height() <= size.height());
QPixmap pixon = icon.pixmap(size, mode, QIcon::On); QPixmap pixon = icon.pixmap(size, mode, QIcon::On);
if(pixon.height() > size.height()) if(pixon.height() > size.height())
pixon = pixoff.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); pixon = pixoff.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
new_icon.addPixmap(pixon, mode, QIcon::On); new_icon.addPixmap(pixon, mode, QIcon::On);
Q_ASSERT(pixon.height() <= size.height());
} }
Q_ASSERT(new_icon.availableSizes().contains(size));
} }
return new_icon; return new_icon;
} }

2
src/preferences/options.ui

@ -923,7 +923,7 @@ QGroupBox {
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-51</y> <y>0</y>
<width>506</width> <width>506</width>
<height>457</height> <height>457</height>
</rect> </rect>

2
src/webui/html/confirmdeletion.html

@ -67,7 +67,7 @@ window.addEvent('domready', function(){
<p>_(Are you sure you want to delete the selected torrents from the transfer list?)</p> <p>_(Are you sure you want to delete the selected torrents from the transfer list?)</p>
&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id="deleteFromDiskCB"/> <i>_(Also delete the files on the hard disk)</i><br/><br/> &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id="deleteFromDiskCB"/> <i>_(Also delete the files on the hard disk)</i><br/><br/>
<div style="text-align: right;"> <div style="text-align: right;">
<input type="button" id="cancelBtn" value="_(No)" />&nbsp;&nbsp;<input type="button" id="confirmBtn" value="Yes"/>&nbsp;&nbsp; <input type="button" id="cancelBtn" value="_(No)" />&nbsp;&nbsp;<input type="button" id="confirmBtn" value="_(Yes)"/>&nbsp;&nbsp;
</div> </div>
</body> </body>
</html> </html>

12
src/webui/html/index.html

@ -35,17 +35,17 @@
<li> <li>
<a class="returnFalse">_(File)</a> <a class="returnFalse">_(File)</a>
<ul> <ul>
<li><a id="uploadLink"><img class="MyMenuIcon" src="theme/list-add" width="16" height="16" onload="fixPNG(this)"/>_(&Add File...)</a></li> <li><a id="uploadLink"><img class="MyMenuIcon" src="theme/list-add" width="16" height="16" onload="fixPNG(this)"/>_(&Add torrent file...)</a></li>
<li><a id="downloadLink"><img class="MyMenuIcon" src="theme/insert-link" width="16" height="16" onload="fixPNG(this)"/>_(Add &URL...)</a></li> <li><a id="downloadLink"><img class="MyMenuIcon" src="theme/insert-link" width="16" height="16" onload="fixPNG(this)"/>_(Add &link to torrent...)</a></li>
</ul> </ul>
</li> </li>
<li> <li>
<a class="returnFalse">_(Edit)</a> <a class="returnFalse">_(Edit)</a>
<ul> <ul>
<li><a id="resumeAllLink"><img class="MyMenuIcon" src="theme/media-playback-start" width="16" height="16" onload="fixPNG(this)"/>_(S&tart All)</a></li> <li><a id="resumeAllLink"><img class="MyMenuIcon" src="theme/media-playback-start" width="16" height="16" onload="fixPNG(this)"/>_(R&esume All)</a></li>
<li><a id="pauseAllLink"><img class="MyMenuIcon" src="theme/media-playback-pause" width="16" height="16" onload="fixPNG(this)"/>_(P&ause All)</a></li> <li><a id="pauseAllLink"><img class="MyMenuIcon" src="theme/media-playback-pause" width="16" height="16" onload="fixPNG(this)"/>_(P&ause All)</a></li>
<li class="divider"><a id="resumeLink"><img class="MyMenuIcon" src="theme/media-playback-start" width="16" height="16" onload="fixPNG(this)"/>_(&Start)</a></li> <li class="divider"><a id="resumeLink"><img class="MyMenuIcon" src="theme/media-playback-start" width="16" height="16" onload="fixPNG(this)"/>_(&Resume)</a></li>
<li><a id="pauseLink"><img class="MyMenuIcon" src="theme/media-playback-pause" width="16" height="16" onload="fixPNG(this)"/>_(&Pause)</a></li> <li><a id="pauseLink"><img class="MyMenuIcon" src="theme/media-playback-pause" width="16" height="16" onload="fixPNG(this)"/>_(&Pause)</a></li>
<li><a id="recheckLink"><img class="MyMenuIcon" src="theme/document-edit-verify" width="16" height="16" onload="fixPNG(this)"/>_(Force recheck)</a></li> <li><a id="recheckLink"><img class="MyMenuIcon" src="theme/document-edit-verify" width="16" height="16" onload="fixPNG(this)"/>_(Force recheck)</a></li>
<li class="divider"><a id="deleteLink"><img class="MyMenuIcon" src="theme/list-remove" width="16" height="16" onload="fixPNG(this)"/>_(&Delete)</a></li> <li class="divider"><a id="deleteLink"><img class="MyMenuIcon" src="theme/list-remove" width="16" height="16" onload="fixPNG(this)"/>_(&Delete)</a></li>
@ -97,8 +97,8 @@
<li><a href="#prioBottom"><img src="theme/go-bottom"/> _(Move to bottom)</a></li> <li><a href="#prioBottom"><img src="theme/go-bottom"/> _(Move to bottom)</a></li>
</ul> </ul>
</li> </li>
<li class="separator"><a href="#DownloadLimit"><img src="images/skin/download.png"/> _(Limit download rate)</a></li> <li class="separator"><a href="#DownloadLimit"><img src="images/skin/download.png"/> _(Limit download rate...)</a></li>
<li><a href="#UploadLimit"><img src="images/skin/seeding.png"/> _(Limit upload rate)</a></li> <li><a href="#UploadLimit"><img src="images/skin/seeding.png"/> _(Limit upload rate...)</a></li>
<li class="separator"><a href="#ForceRecheck"><img src="theme/document-edit-verify"/> _(Force recheck)</a></li> <li class="separator"><a href="#ForceRecheck"><img src="theme/document-edit-verify"/> _(Force recheck)</a></li>
</ul> </ul>
<div id="desktopFooterWrapper"> <div id="desktopFooterWrapper">

4
src/webui/html/preferences_content.html

@ -52,7 +52,7 @@
<td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="dht_checkbox"/></td><td>_(Enable DHT (decentralized network) to find more peers)</td> <td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="dht_checkbox"/></td><td>_(Enable DHT (decentralized network) to find more peers)</td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="DHTPortDiffThanBT_checkbox" onclick="updateDHTPortSettings();"/></td><td>_(Use a different port for DHT and Bittorrent)</td> <td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="DHTPortDiffThanBT_checkbox" onclick="updateDHTPortSettings();"/></td><td>_(Use a different port for DHT and BitTorrent)</td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: bottom; text-align: right;">_(DHT port:)</td><td><input type="text" id="DHTPort_txt" value="6881"/></td> <td style="vertical-align: bottom; text-align: right;">_(DHT port:)</td><td><input type="text" id="DHTPort_txt" value="6881"/></td>
@ -260,7 +260,7 @@
</div> </div>
<br/> <br/>
<center><input type="button" value="_(Apply)" onclick="applyPreferences();"/></center> <center><input type="button" value="_(Save)" onclick="applyPreferences();"/></center>
<script type="text/javascript"> <script type="text/javascript">
var WatchedFoldersTable = new HtmlTable($("watched_folders_tab")); var WatchedFoldersTable = new HtmlTable($("watched_folders_tab"));

2
src/webui/html/prop-general.html

@ -3,7 +3,7 @@
<table> <table>
<tr><td style="text-align:right; padding: 4px;">_(Uploaded:)</td><td style="padding-right: 20px;" id="total_uploaded">0 Kb</td><td style="text-align:right; padding: 4px;">_(UP limit:)</td><td style="padding-right: 20px;" id="up_limit">xx</td><td style="text-align:right; padding: 4px;">_(Share ratio:)</td><td id="share_ratio">xx</td></tr> <tr><td style="text-align:right; padding: 4px;">_(Uploaded:)</td><td style="padding-right: 20px;" id="total_uploaded">0 Kb</td><td style="text-align:right; padding: 4px;">_(UP limit:)</td><td style="padding-right: 20px;" id="up_limit">xx</td><td style="text-align:right; padding: 4px;">_(Share ratio:)</td><td id="share_ratio">xx</td></tr>
<tr><td style="text-align:right; padding: 4px;">_(Downloaded:)</td><td style="padding-right: 20px;" id="total_downloaded">0 Kb</td><td style="text-align:right; padding: 4px;">_(DL limit:)</td><td style="padding-right: 20px;" id="dl_limit">xx</td><td style="text-align:right; padding: 4px;">_(Connections:)</td><td id="nb_connections">xx</td></tr> <tr><td style="text-align:right; padding: 4px;">_(Downloaded:)</td><td style="padding-right: 20px;" id="total_downloaded">0 Kb</td><td style="text-align:right; padding: 4px;">_(DL limit:)</td><td style="padding-right: 20px;" id="dl_limit">xx</td><td style="text-align:right; padding: 4px;">_(Connections:)</td><td id="nb_connections">xx</td></tr>
<tr><td style="text-align:right; padding: 4px;">_(Wasted:)</td><td style="padding-right: 20px;" id="total_wasted">0 Kb</td><td style="text-align:right; padding: 4px;">_(Time elapsed:)</td><td style="padding-right: 20px;" id="time_elapsed">xx</td><td></td></tr> <tr><td style="text-align:right; padding: 4px;">_(Wasted:)</td><td style="padding-right: 20px;" id="total_wasted">0 Kb</td><td style="text-align:right; padding: 4px;">_(Time active:)</td><td style="padding-right: 20px;" id="time_elapsed">xx</td><td></td></tr>
</table> </table>
</fieldset> </fieldset>

2
src/webui/html/properties.html

@ -31,7 +31,7 @@
<ul id="propertiesTabs" class="tab-menu"> <ul id="propertiesTabs" class="tab-menu">
<li id="PropGeneralLink" class="selected"><a>_(General)</a></li> <li id="PropGeneralLink" class="selected"><a>_(General)</a></li>
<li id="PropTrackersLink"><a>_(Trackers)</a></li> <li id="PropTrackersLink"><a>_(Trackers)</a></li>
<li id="PropFilesLink"><a>_(Files)</a></li> <li id="PropFilesLink"><a>_(Content)</a></li>
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
</div> </div>

4
src/webui/httpconnection.cpp

@ -111,7 +111,7 @@ void HttpConnection::write()
} }
QString HttpConnection::translateDocument(QString data) { QString HttpConnection::translateDocument(QString data) {
std::string contexts[] = {"TransferListFiltersWidget", "TransferListWidget", "PropertiesWidget", "GUI", "MainWindow", "HttpServer", "confirmDeletionDlg", "TrackerList", "TorrentFilesModel", "options_imp", "Preferences", "TrackersAdditionDlg", "ScanFoldersModel"}; std::string contexts[] = {"TransferListFiltersWidget", "TransferListWidget", "PropertiesWidget", "MainWindow", "HttpServer", "confirmDeletionDlg", "TrackerList", "TorrentFilesModel", "options_imp", "Preferences", "TrackersAdditionDlg", "ScanFoldersModel", "PropTabBar", "TorrentModel"};
int i=0; int i=0;
bool found = false; bool found = false;
do { do {
@ -126,7 +126,7 @@ QString HttpConnection::translateDocument(QString data) {
do { do {
translation = qApp->translate(contexts[context_index].c_str(), word.toLocal8Bit().constData(), 0, QCoreApplication::UnicodeUTF8, 1); translation = qApp->translate(contexts[context_index].c_str(), word.toLocal8Bit().constData(), 0, QCoreApplication::UnicodeUTF8, 1);
++context_index; ++context_index;
}while(translation == word && context_index < 13); }while(translation == word && context_index < 14);
// Remove keyboard shortcuts // Remove keyboard shortcuts
translation = translation.replace("&", ""); translation = translation.replace("&", "");
//qDebug("Translation is %s", translation.toUtf8().data()); //qDebug("Translation is %s", translation.toUtf8().data());

2
src/webui/httpserver.cpp

@ -107,7 +107,6 @@ HttpServer::HttpServer(int msec, QObject* parent) : QTcpServer(parent) {
QString a = tr("File"); QString a = tr("File");
a = tr("Edit"); a = tr("Edit");
a = tr("Help"); a = tr("Help");
a = tr("Delete from HD");
a = tr("Download Torrents from their URL or Magnet link"); a = tr("Download Torrents from their URL or Magnet link");
a = tr("Only one link per line"); a = tr("Only one link per line");
a = tr("Download local torrent"); a = tr("Download local torrent");
@ -127,6 +126,7 @@ HttpServer::HttpServer(int msec, QObject* parent) : QTcpServer(parent) {
a = tr("The port used for the Web UI must be greater than 1024 and less than 65535."); a = tr("The port used for the Web UI must be greater than 1024 and less than 65535.");
a = tr("The Web UI username must be at least 3 characters long."); a = tr("The Web UI username must be at least 3 characters long.");
a = tr("The Web UI password must be at least 3 characters long."); a = tr("The Web UI password must be at least 3 characters long.");
a = tr("Save");
} }
HttpServer::~HttpServer() HttpServer::~HttpServer()

Loading…
Cancel
Save