Browse Source

Fix Web UI translation

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
7778877fa7
  1. 4
      src/httpconnection.cpp
  2. BIN
      src/lang/qbittorrent_fr.qm
  3. 2
      src/lang/qbittorrent_fr.ts
  4. 28
      src/webui/index.html
  5. 2
      src/webui/preferences.html
  6. 18
      src/webui/preferences_content.html
  7. 2
      src/webui/scripts/mocha-init.js

4
src/httpconnection.cpp

@ -109,7 +109,7 @@ QString HttpConnection::translateDocument(QString data) {
bool found = false; bool found = false;
do { do {
found = false; found = false;
QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),µ\\-\\.]+)\\)")); QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),µ&\\-\\.]+)\\)"));
i = regex.indexIn(data, i); i = regex.indexIn(data, i);
if(i >= 0) { if(i >= 0) {
//qDebug("Found translatable string: %s", regex.cap(1).toUtf8().data()); //qDebug("Found translatable string: %s", regex.cap(1).toUtf8().data());
@ -120,6 +120,8 @@ QString HttpConnection::translateDocument(QString data) {
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 < 13);
// Remove keyboard shortcuts
translation = translation.replace("&", "");
//qDebug("Translation is %s", translation.toUtf8().data()); //qDebug("Translation is %s", translation.toUtf8().data());
data = data.replace(i, regex.matchedLength(), translation); data = data.replace(i, regex.matchedLength(), translation);
i += translation.length(); i += translation.length();

BIN
src/lang/qbittorrent_fr.qm

Binary file not shown.

2
src/lang/qbittorrent_fr.ts

@ -3816,7 +3816,7 @@ Ce message d&apos;avertissement ne sera plus affiché.</translation>
<message> <message>
<location filename="../ui/mainwindow.ui" line="180"/> <location filename="../ui/mainwindow.ui" line="180"/>
<source>S&amp;tart All</source> <source>S&amp;tart All</source>
<translation>Tout déma&amp;rrrer</translation> <translation>Tout déma&amp;rrer</translation>
</message> </message>
<message> <message>
<location filename="../ui/mainwindow.ui" line="185"/> <location filename="../ui/mainwindow.ui" line="185"/>

28
src/webui/index.html

@ -35,36 +35,36 @@
<li> <li>
<a class="returnFalse">_(File)</a> <a class="returnFalse">_(File)</a>
<ul> <ul>
<li><a id="uploadLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/open.png" width="16" height="16" onload="fixPNG(this)"/>_(Open torrent)</a></li> <li><a id="uploadLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/open.png" width="16" height="16" onload="fixPNG(this)"/>_(&Add File...)</a></li>
<li><a id="downloadLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/url.png" width="16" height="16" onload="fixPNG(this)"/>_(Download from URL)</a></li> <li><a id="downloadLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/url.png" width="16" height="16" onload="fixPNG(this)"/>_(Add &URL...)</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" alt="_(Download local torrent)" src="images/skin/play_all.png" width="16" height="16" onload="fixPNG(this)"/>_(Start All)</a></li> <li><a id="resumeAllLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/play_all.png" width="16" height="16" onload="fixPNG(this)"/>_(S&tart All)</a></li>
<li><a id="pauseAllLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/pause_all.png" width="16" height="16" onload="fixPNG(this)"/>_(Pause All)</a></li> <li><a id="pauseAllLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/pause_all.png" width="16" height="16" onload="fixPNG(this)"/>_(P&ause All)</a></li>
<li class="divider"><a id="resumeLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/play.png" width="16" height="16" onload="fixPNG(this)"/>_(Start)</a></li> <li class="divider"><a id="resumeLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/play.png" width="16" height="16" onload="fixPNG(this)"/>_(&Start)</a></li>
<li><a id="pauseLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/pause.png" width="16" height="16" onload="fixPNG(this)"/>_(Pause)</a></li> <li><a id="pauseLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/pause.png" width="16" height="16" onload="fixPNG(this)"/>_(&Pause)</a></li>
<li><a id="recheckLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/oxygen/gear.png" width="16" height="16" onload="fixPNG(this)"/>_(Force recheck)</a></li> <li><a id="recheckLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/oxygen/gear.png" width="16" height="16" onload="fixPNG(this)"/>_(Force recheck)</a></li>
<li class="divider"><a id="deleteLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/delete.png" width="16" height="16" onload="fixPNG(this)"/>_(Delete)</a></li> <li class="divider"><a id="deleteLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/delete.png" width="16" height="16" onload="fixPNG(this)"/>_(&Delete)</a></li>
<li><a id="deletePermLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/delete_perm.png" width="16" height="16" onload="fixPNG(this)"/>_(Delete from HD)</a></li> <li><a id="deletePermLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/delete_perm.png" width="16" height="16" onload="fixPNG(this)"/>_(Delete from HD)</a></li>
</ul> </ul>
</li> </li>
<li> <li>
<a class="returnFalse">_(Options)</a> <a class="returnFalse">_(&Tools)</a>
<ul> <ul>
<li><a id="preferencesLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/settings.png" width="16" height="16" onload="fixPNG(this)"/>_(Preferences)</a></li> <li><a id="preferencesLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/settings.png" width="16" height="16" onload="fixPNG(this)"/>_(&Options...)</a></li>
</ul> </ul>
</li> </li>
<li> <li>
<a class="returnFalse">_(Help)</a> <a class="returnFalse">_(&Help)</a>
<ul> <ul>
<li><a id="bugLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/oxygen/bug.png" width="16" height="16" onload="fixPNG(this)"/>_(Report a bug)</a></li> <li><a id="bugLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/oxygen/bug.png" width="16" height="16" onload="fixPNG(this)"/>_(Report a &bug)</a></li>
<li><a id="siteLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/qbittorrent16.png" width="16" height="16" onload="fixPNG(this)"/>_(Visit Website)</a></li> <li><a id="siteLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/qbittorrent16.png" width="16" height="16" onload="fixPNG(this)"/>_(Visit &Website)</a></li>
<li><a id="docsLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/qb_question.png" width="16" height="16" onload="fixPNG(this)"/>_(Documentation)</a></li> <li><a id="docsLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/qb_question.png" width="16" height="16" onload="fixPNG(this)"/>_(&Documentation)</a></li>
<li><a id="aboutLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/info.png" width="16" height="16" onload="fixPNG(this)"/>_(About)</a></li> <li><a id="aboutLink"><img class="MyMenuIcon" alt="_(Download local torrent)" src="images/skin/info.png" width="16" height="16" onload="fixPNG(this)"/>_(&About)</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>

2
src/webui/preferences.html

@ -17,7 +17,7 @@
<li id="PrefBittorrentLink"><a>_(Bittorrent)</a></li> <li id="PrefBittorrentLink"><a>_(Bittorrent)</a></li>
<li id="PrefDownloadsLink"><a>_(Downloads)</a></li> <li id="PrefDownloadsLink"><a>_(Downloads)</a></li>
<li id="PrefProxyLink"><a>_(Proxy)</a></li> <li id="PrefProxyLink"><a>_(Proxy)</a></li>
<li id="PrefFilterLink"><a>_(IP Filter)</a></li> <li id="PrefFilterLink"><a>_(IP Filtering)</a></li>
<li id="PrefWebUILink"><a>_(Web UI)</a></li> <li id="PrefWebUILink"><a>_(Web UI)</a></li>
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>

18
src/webui/preferences_content.html

@ -32,7 +32,7 @@
</div> </div>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend><b>_(Global bandwidth limiting)</b></legend> <legend><b>_(Global speed limits)</b></legend>
<div style="padding-left: 30px;"> <div style="padding-left: 30px;">
<table> <table>
<tr> <tr>
@ -98,15 +98,15 @@
<div style="padding-left: 30px;"> <div style="padding-left: 30px;">
<table> <table>
<tr> <tr>
<td style="vertical-align: bottom; text-align: right;">_(Destination Folder:)</td><td><input type="text" id="savepath_text"/></td> <td style="vertical-align: bottom; text-align: right;">_(Save files to location:)</td><td><input type="text" id="savepath_text"/></td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="temppath_checkbox" onclick="updateTempDirEnabled();"/></td><td>_(Use a different folder for incomplete downloads:)</td> <td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="temppath_checkbox" onclick="updateTempDirEnabled();"/></td><td>_(Keep incomplete torrents in:)</td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: bottom; text-align: right;"></td><td><input type="text" id="temppath_text"/></td> <td style="vertical-align: bottom; text-align: right;"></td><td><input type="text" id="temppath_text"/></td>
</tr> </tr>
<tr><td colspan="2">_(Check Folders for .torrent Files:)</td></tr> <tr><td colspan="2">_(Automatically add torrents from:)</td></tr>
<tr> <tr>
<td></td> <td></td>
<td> <td>
@ -127,7 +127,7 @@
<td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="appendext_checkbox"/></td><td>_(Append .!qB extension to incomplete files)</td> <td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="appendext_checkbox"/></td><td>_(Append .!qB extension to incomplete files)</td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="preallocateall_checkbox"/></td><td>_(Pre-allocate all files)</td> <td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="preallocateall_checkbox"/></td><td>_(Pre-allocate disk space for all files)</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -137,7 +137,7 @@
<div style="padding-left: 30px;"> <div style="padding-left: 30px;">
<table> <table>
<tr> <tr>
<td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="queueing_checkbox" onclick="updateQueuingSystem();"/></td><td>_(Enable queueing system)</td> <td style="vertical-align: bottom; text-align: right;"><input type="checkbox" id="queueing_checkbox" onclick="updateQueuingSystem();"/></td><td>_(Torrent queueing)</td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: bottom; text-align: right;">_(Maximum active downloads:)</td><td><input type="text" id="max_active_dl_value" style="width: 4em;"/></td> <td style="vertical-align: bottom; text-align: right;">_(Maximum active downloads:)</td><td><input type="text" id="max_active_dl_value" style="width: 4em;"/></td>
@ -154,9 +154,9 @@
</div> </div>
<div id="FilterTab" class="PrefTab invisible"> <div id="FilterTab" class="PrefTab invisible">
<legend><b>_(Filter Settings)</b></legend> <legend><b>_(IP Filtering)</b></legend>
<div style="padding-left: 30px;"> <div style="padding-left: 30px;">
<input type="checkbox" id="ipfilter_enabled_checkbox" onclick="updateFilterSettings();"/> _(Activate IP Filtering) <input type="checkbox" id="ipfilter_enabled_checkbox" onclick="updateFilterSettings();"/> _(IP Filtering)
<table> <table>
<tr> <tr>
<td style="vertical-align: bottom;">_(Filter path (.dat, .p2p, .p2b):)</td><td><input type="text" id="ipfilter_text"/></td> <td style="vertical-align: bottom;">_(Filter path (.dat, .p2p, .p2b):)</td><td><input type="text" id="ipfilter_text"/></td>
@ -206,7 +206,7 @@
<div id="WebUITab" class="PrefTab invisible"> <div id="WebUITab" class="PrefTab invisible">
<fieldset> <fieldset>
<legend><b>_(User interface)</b></legend> <legend><b>_(Visual Appearance)</b></legend>
<div style="padding-left: 30px;"> <div style="padding-left: 30px;">
<table> <table>
<tr> <tr>

2
src/webui/scripts/mocha-init.js

@ -41,7 +41,7 @@ initializeWindows = function(){
new Event(e).stop(); new Event(e).stop();
new MochaUI.Window({ new MochaUI.Window({
id: 'preferencesPage', id: 'preferencesPage',
title: "_(Preferences)", title: "_(Options)",
loadMethod: 'xhr', loadMethod: 'xhr',
toolbar: true, toolbar: true,
contentURL: 'preferences_content.html', contentURL: 'preferences_content.html',

Loading…
Cancel
Save