Fix #923465 (Some untranslated strings on calibre interface)

This commit is contained in:
Kovid Goyal 2012-02-01 18:40:32 +05:30
parent 64265d0465
commit 1b63c8ed1c
3 changed files with 113 additions and 69 deletions

View File

@ -257,7 +257,8 @@ def extension(path):
def warning_dialog(parent, title, msg, det_msg='', show=False,
show_copy_button=True):
from calibre.gui2.dialogs.message_box import MessageBox
d = MessageBox(MessageBox.WARNING, 'WARNING: '+title, msg, det_msg, parent=parent,
d = MessageBox(MessageBox.WARNING, _('WARNING:')+ ' ' +
title, msg, det_msg, parent=parent,
show_copy_button=show_copy_button)
if show:
return d.exec_()
@ -266,7 +267,8 @@ def warning_dialog(parent, title, msg, det_msg='', show=False,
def error_dialog(parent, title, msg, det_msg='', show=False,
show_copy_button=True):
from calibre.gui2.dialogs.message_box import MessageBox
d = MessageBox(MessageBox.ERROR, 'ERROR: '+title, msg, det_msg, parent=parent,
d = MessageBox(MessageBox.ERROR, _('ERROR:')+ ' ' +
title, msg, det_msg, parent=parent,
show_copy_button=show_copy_button)
if show:
return d.exec_()

View File

@ -11,8 +11,8 @@ from Queue import Empty, Queue
from contextlib import closing
from PyQt4.Qt import QWizard, QWizardPage, QPixmap, Qt, QAbstractListModel, \
QVariant, QItemSelectionModel, SIGNAL, QObject, QTimer
from PyQt4.Qt import (QWizard, QWizardPage, QPixmap, Qt, QAbstractListModel,
QVariant, QItemSelectionModel, SIGNAL, QObject, QTimer, pyqtSignal)
from calibre import __appname__, patheq
from calibre.library.database2 import LibraryDatabase2
from calibre.library.move import MoveLibrary
@ -613,6 +613,7 @@ def move_library(oldloc, newloc, parent, callback_on_complete):
class LibraryPage(QWizardPage, LibraryUI):
ID = 1
retranslate = pyqtSignal()
def __init__(self):
QWizardPage.__init__(self)
@ -620,8 +621,7 @@ class LibraryPage(QWizardPage, LibraryUI):
self.registerField('library_location', self.location)
self.connect(self.button_change, SIGNAL('clicked()'), self.change)
self.init_languages()
self.connect(self.language, SIGNAL('currentIndexChanged(int)'),
self.change_language)
self.language.currentIndexChanged[int].connect(self.change_language)
self.connect(self.location, SIGNAL('textChanged(QString)'),
self.location_text_changed)
@ -660,7 +660,7 @@ class LibraryPage(QWizardPage, LibraryUI):
from calibre.gui2 import qt_app
set_translators()
qt_app.load_translations()
self.emit(SIGNAL('retranslate()'))
self.retranslate.emit()
self.init_languages()
try:
lang = prefs['language'].lower()[:2]
@ -780,6 +780,22 @@ class FinishPage(QWizardPage, FinishUI):
class Wizard(QWizard):
BUTTON_TEXTS = {
'Next': '&Next >',
'Back': '< &Back',
'Cancel': 'Cancel',
'Finish': '&Finish',
'Commit': 'Commit'
}
# The latter is simply to mark the texts for translation
if False:
_('&Next >')
_('< &Back')
_('Cancel')
_('&Finish')
_('Commit')
def __init__(self, parent):
QWizard.__init__(self, parent)
self.setWindowTitle(__appname__+' '+_('welcome wizard'))
@ -792,8 +808,7 @@ class Wizard(QWizard):
self.setPixmap(self.BackgroundPixmap, QPixmap(I('wizard.png')))
self.device_page = DevicePage()
self.library_page = LibraryPage()
self.connect(self.library_page, SIGNAL('retranslate()'),
self.retranslate)
self.library_page.retranslate.connect(self.retranslate)
self.finish_page = FinishPage()
self.set_finish_text()
self.kindle_page = KindlePage()
@ -813,12 +828,18 @@ class Wizard(QWizard):
nh = min(400, nh)
nw = min(580, nw)
self.resize(nw, nh)
self.set_button_texts()
def set_button_texts(self):
for but, text in self.BUTTON_TEXTS.iteritems():
self.setButtonText(getattr(self, but+'Button'), _(text))
def retranslate(self):
for pid in self.pageIds():
page = self.page(pid)
page.retranslateUi(page)
self.set_finish_text()
self.set_button_texts()
def accept(self):
pages = map(self.page, self.visitedPages())

View File

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: calibre 0.8.37\n"
"POT-Creation-Date: 2012-01-27 10:12+IST\n"
"PO-Revision-Date: 2012-01-27 10:12+IST\n"
"POT-Creation-Date: 2012-02-01 18:34+IST\n"
"PO-Revision-Date: 2012-02-01 18:34+IST\n"
"Last-Translator: Automatically generated\n"
"Language-Team: LANGUAGE\n"
"MIME-Version: 1.0\n"
@ -24,8 +24,8 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/db/cache.py:106
#: /home/kovid/work/calibre/src/calibre/db/cache.py:109
#: /home/kovid/work/calibre/src/calibre/db/cache.py:120
#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:287
#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:288
#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:289
#: /home/kovid/work/calibre/src/calibre/devices/hanvon/driver.py:100
#: /home/kovid/work/calibre/src/calibre/devices/hanvon/driver.py:101
#: /home/kovid/work/calibre/src/calibre/devices/jetbook/driver.py:74
@ -103,8 +103,8 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:1031
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/utils.py:299
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer2/indexer.py:497
#: /home/kovid/work/calibre/src/calibre/ebooks/odt/input.py:145
#: /home/kovid/work/calibre/src/calibre/ebooks/odt/input.py:147
#: /home/kovid/work/calibre/src/calibre/ebooks/odt/input.py:169
#: /home/kovid/work/calibre/src/calibre/ebooks/odt/input.py:171
#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:827
#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/parse_utils.py:353
#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/parse_utils.py:357
@ -137,8 +137,8 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/ebooks/pdf/writer.py:103
#: /home/kovid/work/calibre/src/calibre/ebooks/rtf/input.py:320
#: /home/kovid/work/calibre/src/calibre/ebooks/rtf/input.py:322
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:410
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:418
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:412
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:420
#: /home/kovid/work/calibre/src/calibre/gui2/actions/add.py:158
#: /home/kovid/work/calibre/src/calibre/gui2/actions/edit_metadata.py:378
#: /home/kovid/work/calibre/src/calibre/gui2/actions/edit_metadata.py:381
@ -195,8 +195,8 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/utils/podofo/__init__.py:46
#: /home/kovid/work/calibre/src/calibre/utils/podofo/__init__.py:66
#: /home/kovid/work/calibre/src/calibre/utils/podofo/__init__.py:88
#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/collection.py:46
#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/collection.py:54
#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/collection.py:45
#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/collection.py:53
msgid "Unknown"
msgstr ""
@ -889,15 +889,15 @@ msgstr ""
msgid "Communicate with Android phones."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:156
#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:157
msgid "Comma separated list of directories to send e-books to on the device. The first one that exists will be used"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:227
#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:228
msgid "Communicate with S60 phones."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:246
#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:247
msgid "Communicate with WebOS tablets."
msgstr ""
@ -999,9 +999,9 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/devices/prs505/sony_cache.py:470
#: /home/kovid/work/calibre/src/calibre/devices/prst1/driver.py:552
#: /home/kovid/work/calibre/src/calibre/devices/prst1/driver.py:571
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:1032
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:1038
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:1073
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:1053
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:1059
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:1094
#: /home/kovid/work/calibre/src/calibre/gui2/actions/fetch_news.py:73
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:464
#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/model.py:1148
@ -1687,30 +1687,26 @@ msgstr ""
msgid "The main memory of %s is read only. This usually happens because of file system errors."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:758
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:801
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:811
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:821
#, python-format
msgid "Could not find mount helper: %s."
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:809
msgid "Unable to mount the device"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:959
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:961
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:980
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:982
msgid "The reader has no storage card in this slot."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:963
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:984
#, python-format
msgid "Selected slot: %s is not supported."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:992
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:1013
msgid "There is insufficient free space in main memory"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:994
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:996
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:1015
#: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:1017
msgid "There is insufficient free space on the storage card"
msgstr ""
@ -3705,11 +3701,19 @@ msgstr ""
msgid "tag browser categories not to display"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:280
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:260
msgid "WARNING:"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:270
msgid "ERROR:"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:282
msgid "Show this confirmation again"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:529
#: /home/kovid/work/calibre/src/calibre/gui2/__init__.py:531
msgid "Choose Files"
msgstr ""
@ -14588,7 +14592,28 @@ msgstr ""
msgid "You must choose an empty folder for the calibre library. %s is not empty."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/wizard/__init__.py:785
#: /home/kovid/work/calibre/src/calibre/gui2/wizard/__init__.py:792
msgid "&Next >"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/wizard/__init__.py:793
msgid "< &Back"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/wizard/__init__.py:794
#: /usr/src/qt-everywhere-opensource-src-4.7.3/src/gui/widgets/qdialogbuttonbox.cpp:658
msgid "Cancel"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/wizard/__init__.py:795
msgid "&Finish"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/wizard/__init__.py:796
msgid "Commit"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/wizard/__init__.py:801
msgid "welcome wizard"
msgstr ""
@ -16813,114 +16838,114 @@ msgstr ""
msgid "Unknown News Source"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:750
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:752
#, python-format
msgid "The \"%s\" recipe needs a username and password."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:857
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:859
msgid "Download finished"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:859
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:861
msgid "Failed to download the following articles:"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:865
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:867
msgid "Failed to download parts of the following articles:"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:867
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:869
msgid " from "
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:869
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:871
msgid "\tFailed links:"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:971
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:973
msgid "Could not fetch article."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:973
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:975
msgid "The debug traceback is available earlier in this log"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:975
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:977
msgid "Run with -vv to see the reason"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:998
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1000
msgid "Fetching feeds..."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1003
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1005
msgid "Got feeds from index page"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1012
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1014
msgid "Trying to download cover..."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1014
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1016
msgid "Generating masthead..."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1094
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1096
#, python-format
msgid "Starting download [%d thread(s)]..."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1110
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1112
#, python-format
msgid "Feeds downloaded to %s"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1119
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1121
#, python-format
msgid "Could not download cover: %s"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1128
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1130
#, python-format
msgid "Downloading cover from %s"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1174
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1176
msgid "Masthead image downloaded"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1255
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1257
msgid "Articles in this issue: "
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1327
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1329
msgid "Untitled Article"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1399
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1401
#, python-format
msgid "Article downloaded: %s"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1410
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1412
#, python-format
msgid "Article download failed: %s"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1427
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1429
msgid "Fetching feed"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1571
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1573
msgid "Failed to log in, check your username and password for the calibre Periodicals service."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1586
#: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:1588
msgid "You do not have permission to download this issue. Either your subscription has expired or you have exceeded the maximum allowed downloads for today."
msgstr ""
#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/collection.py:46
#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/collection.py:45
msgid "You"
msgstr ""
@ -17019,10 +17044,6 @@ msgstr ""
msgid "Open"
msgstr ""
#: /usr/src/qt-everywhere-opensource-src-4.7.3/src/gui/widgets/qdialogbuttonbox.cpp:658
msgid "Cancel"
msgstr ""
#: /usr/src/qt-everywhere-opensource-src-4.7.3/src/gui/widgets/qdialogbuttonbox.cpp:661
msgid "&Close"
msgstr ""