Browse Source

- Extended internationalization support in Web UI to the Javascript scripts

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
74f0737903
  1. 1
      Changelog
  2. 8
      src/httpconnection.cpp
  3. 1
      src/httpserver.cpp
  4. 5
      src/lang/qbittorrent_bg.ts
  5. 5
      src/lang/qbittorrent_ca.ts
  6. 5
      src/lang/qbittorrent_cs.ts
  7. 5
      src/lang/qbittorrent_da.ts
  8. 5
      src/lang/qbittorrent_de.ts
  9. 5
      src/lang/qbittorrent_el.ts
  10. 5
      src/lang/qbittorrent_en.ts
  11. 5
      src/lang/qbittorrent_es.ts
  12. 5
      src/lang/qbittorrent_fi.ts
  13. BIN
      src/lang/qbittorrent_fr.qm
  14. 5
      src/lang/qbittorrent_fr.ts
  15. 5
      src/lang/qbittorrent_hu.ts
  16. 5
      src/lang/qbittorrent_it.ts
  17. 5
      src/lang/qbittorrent_ja.ts
  18. 5
      src/lang/qbittorrent_ko.ts
  19. 5
      src/lang/qbittorrent_nb.ts
  20. 4
      src/lang/qbittorrent_nl.ts
  21. 4
      src/lang/qbittorrent_pl.ts
  22. 4
      src/lang/qbittorrent_pt.ts
  23. 4
      src/lang/qbittorrent_pt_BR.ts
  24. 4
      src/lang/qbittorrent_ro.ts
  25. 4
      src/lang/qbittorrent_ru.ts
  26. 4
      src/lang/qbittorrent_sk.ts
  27. 4
      src/lang/qbittorrent_sv.ts
  28. 4
      src/lang/qbittorrent_tr.ts
  29. 4
      src/lang/qbittorrent_uk.ts
  30. 4
      src/lang/qbittorrent_zh.ts
  31. 4
      src/lang/qbittorrent_zh_TW.ts
  32. 4
      src/webui/scripts/mocha-init.js

1
Changelog

@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
- FEATURE: Support for bitcomet padding files (libtorrent >= v0.15 only)
- FEATURE: Option to skip file checking and start seeding immediately in torrent addition dialog (Stephanos Antaris) (libtorrent >= v0.15 only)
- WEB UI: Removed Web UI to match new qBittorrent UI
- WEB UI: Added internationalization support
- COSMETIC: Merged download / upload lists
- COSMETIC: Torrents can be filtered based on their status
- COSMETIC: Torrent properties are now displayed in main window

8
src/httpconnection.cpp

@ -102,12 +102,12 @@ void HttpConnection::write() @@ -102,12 +102,12 @@ void HttpConnection::write()
}
QString HttpConnection::translateDocument(QString data) {
std::string contexts[] = {"TransferListFiltersWidget", "TransferListWidget", "PropertiesWidget", "GUI", "MainWindow", "HttpServer"};
std::string contexts[] = {"TransferListFiltersWidget", "TransferListWidget", "PropertiesWidget", "GUI", "MainWindow", "HttpServer", "confirmDeletionDlg"};
int i=0;
bool found = false;
do {
found = false;
QRegExp regex("_\\(([\\w\\s]+)\\)");
QRegExp regex("_\\(([\\w\\s?!]+)\\)");
i = regex.indexIn(data, i);
if(i >= 0) {
qDebug("Found translatable string: %s", regex.cap(1).toUtf8().data());
@ -117,7 +117,7 @@ QString HttpConnection::translateDocument(QString data) { @@ -117,7 +117,7 @@ QString HttpConnection::translateDocument(QString data) {
do {
translation = qApp->translate(contexts[context_index].c_str(), word.toLocal8Bit().data(), 0, QCoreApplication::UnicodeUTF8, 1);
++context_index;
}while(translation == word && context_index < 6);
}while(translation == word && context_index < 7);
qDebug("Translation is %s", translation.toUtf8().data());
data = data.replace(i, regex.matchedLength(), translation);
i += translation.length();
@ -185,7 +185,7 @@ void HttpConnection::respond() @@ -185,7 +185,7 @@ void HttpConnection::respond()
ext.clear();
QByteArray data = file.readAll();
// Translate the page
if(ext == "html") {
if(ext == "html" || ext == "js") {
data = translateDocument(QString::fromUtf8(data.data())).toUtf8();
}
generator.setStatusLine(200, "OK");

1
src/httpserver.cpp

@ -67,6 +67,7 @@ HttpServer::HttpServer(Bittorrent *_BTSession, int msec, QObject* parent) : QTcp @@ -67,6 +67,7 @@ HttpServer::HttpServer(Bittorrent *_BTSession, int msec, QObject* parent) : QTcp
a = tr("Torrent files were correctly added to download list.");
a = tr("Point to torrent file");
a = tr("Download");
a = tr("Are you sure you want to delete the selected torrents from the transfer list and hard disk?");
}
HttpServer::~HttpServer()

5
src/lang/qbittorrent_bg.ts

@ -2839,6 +2839,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2839,6 +2839,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Свали</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_ca.ts

@ -2315,6 +2315,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2315,6 +2315,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Descàrrega</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_cs.ts

@ -1904,6 +1904,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -1904,6 +1904,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Stáhnout</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_da.ts

@ -2042,6 +2042,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2042,6 +2042,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_de.ts

@ -2806,6 +2806,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2806,6 +2806,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Lade</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_el.ts

@ -2908,6 +2908,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2908,6 +2908,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Κατέβασμα</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_en.ts

@ -1357,6 +1357,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -1357,6 +1357,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_es.ts

@ -2749,6 +2749,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2749,6 +2749,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Descargar</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_fi.ts

@ -2489,6 +2489,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2489,6 +2489,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Lataa</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

BIN
src/lang/qbittorrent_fr.qm

Binary file not shown.

5
src/lang/qbittorrent_fr.ts

@ -2984,6 +2984,11 @@ Etes-vous certain de vouloir quitter qBittorrent ?</translation> @@ -2984,6 +2984,11 @@ Etes-vous certain de vouloir quitter qBittorrent ?</translation>
<source>Download</source>
<translation>Télécharger</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation>Etes-vous certain de vouloir supprimer les torrents sélectionnés de la liste et du disque dur ?</translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_hu.ts

@ -2334,6 +2334,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2334,6 +2334,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Letöltés</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_it.ts

@ -2661,6 +2661,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2661,6 +2661,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Download</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_ja.ts

@ -2264,6 +2264,11 @@ qBittorrent を終了してもよろしいですか?</translation> @@ -2264,6 +2264,11 @@ qBittorrent を終了してもよろしいですか?</translation>
<source>Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_ko.ts

@ -2831,6 +2831,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2831,6 +2831,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

5
src/lang/qbittorrent_nb.ts

@ -2244,6 +2244,11 @@ Are you sure you want to quit qBittorrent?</source> @@ -2244,6 +2244,11 @@ Are you sure you want to quit qBittorrent?</source>
<source>Download</source>
<translation type="unfinished">Last ned</translation>
</message>
<message>
<location filename="../httpserver.cpp" line="70"/>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_nl.ts

@ -2504,6 +2504,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2504,6 +2504,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_pl.ts

@ -2526,6 +2526,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2526,6 +2526,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_pt.ts

@ -2433,6 +2433,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2433,6 +2433,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_pt_BR.ts

@ -2433,6 +2433,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2433,6 +2433,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_ro.ts

@ -2360,6 +2360,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2360,6 +2360,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_ru.ts

@ -2521,6 +2521,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2521,6 +2521,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_sk.ts

@ -2446,6 +2446,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2446,6 +2446,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_sv.ts

@ -1495,6 +1495,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -1495,6 +1495,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_tr.ts

@ -2506,6 +2506,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2506,6 +2506,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_uk.ts

@ -2380,6 +2380,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2380,6 +2380,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_zh.ts

@ -2641,6 +2641,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -2641,6 +2641,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

4
src/lang/qbittorrent_zh_TW.ts

@ -1590,6 +1590,10 @@ Are you sure you want to quit qBittorrent?</source> @@ -1590,6 +1590,10 @@ Are you sure you want to quit qBittorrent?</source>
<source>Point to torrent file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the selected torrents from the transfer list and hard disk?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>

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

@ -64,7 +64,7 @@ initializeWindows = function(){ @@ -64,7 +64,7 @@ initializeWindows = function(){
addClickEvent('delete', function(e){
new Event(e).stop();
var h = myTable.selectedIds();
if(h.length && confirm('Are you sure you want to delete the selected item in download list?')) {
if(h.length && confirm('_(Are you sure you want to delete the selected torrents from the transfer list?)')) {
h.each(function(item, index){
new Request({url: '/command/delete', method: 'post', data: {hash: item}}).send();
});
@ -76,7 +76,7 @@ initializeWindows = function(){ @@ -76,7 +76,7 @@ initializeWindows = function(){
addClickEvent('deletePerm', function(e){
new Event(e).stop();
var h = myTable.selectedIds();
if(h.length && confirm('Are you sure you want to delete from hard drive the selected item in download list?')) {
if(h.length && confirm('_(Are you sure you want to delete the selected torrents from the transfer list and hard disk?)')) {
h.each(function(item, index){
new Request({url: '/command/deletePerm', method: 'post', data: {hash: item}}).send();
});

Loading…
Cancel
Save