forked from openlp/openlp
Fixed all translate() function in ImagePlugin
This commit is contained in:
parent
0788937721
commit
febb743acd
@ -67,10 +67,11 @@ class CustomPlugin(Plugin):
|
||||
self.remove_toolbox_item()
|
||||
|
||||
def about(self):
|
||||
about_text = translate('CustomPlugin','<b>Custom Plugin</b><br>This plugin '
|
||||
'allows slides to be displayed on the screen in the same way '
|
||||
'songs are. This plugin provides greater freedom over the '
|
||||
'songs plugin.<br>')
|
||||
about_text = translate(u'CustomPlugin.CustomPlugin',
|
||||
u'<b>Custom Plugin</b><br>This plugin '
|
||||
u'allows slides to be displayed on the screen in the same way '
|
||||
u'songs are. This plugin provides greater freedom over the '
|
||||
u'songs plugin.<br>')
|
||||
return about_text
|
||||
|
||||
def can_delete_theme(self, theme):
|
||||
|
@ -153,23 +153,46 @@ class Ui_customEditDialog(object):
|
||||
customEditDialog.setTabOrder(self.DownButton, self.ThemeComboBox)
|
||||
|
||||
def retranslateUi(self, customEditDialog):
|
||||
customEditDialog.setWindowTitle(translate('EditCustomForm', 'Edit Custom Slides'))
|
||||
self.UpButton.setToolTip(translate('EditCustomForm', 'Move slide Up 1'))
|
||||
self.DownButton.setToolTip(translate('EditCustomForm', 'Move slide down 1'))
|
||||
self.TitleLabel.setText(translate('EditCustomForm', 'Title:'))
|
||||
self.AddButton.setText(translate('EditCustomForm', 'Add New'))
|
||||
self.AddButton.setToolTip(translate('EditCustomForm', 'Add new slide at bottom'))
|
||||
self.EditButton.setText(translate('EditCustomForm', 'Edit'))
|
||||
self.EditButton.setToolTip(translate('EditCustomForm', 'Edit selected slide'))
|
||||
self.EditAllButton.setText(translate('EditCustomForm', 'Edit All'))
|
||||
self.EditAllButton.setToolTip(translate('EditCustomForm', 'Edit all slides'))
|
||||
self.SaveButton.setText(translate('EditCustomForm', 'Save'))
|
||||
self.SaveButton.setToolTip(translate('EditCustomForm', 'Replace edited slide'))
|
||||
self.DeleteButton.setText(translate('EditCustomForm', 'Delete'))
|
||||
self.DeleteButton.setToolTip(translate('EditCustomForm', 'Delete selected slide'))
|
||||
self.ClearButton.setText(translate('EditCustomForm', 'Clear'))
|
||||
self.ClearButton.setToolTip(translate('EditCustomForm', 'Clear edit area'))
|
||||
self.SplitButton.setText(translate('EditCustomForm', 'Split Slide'))
|
||||
self.SplitButton.setToolTip(translate('EditCustomForm', 'Add slide split'))
|
||||
self.ThemeLabel.setText(translate('EditCustomForm', 'Theme:'))
|
||||
self.CreditLabel.setText(translate('EditCustomForm', 'Credits:'))
|
||||
customEditDialog.setWindowTitle(translate(u'CustomPlugin.EditCustomForm',
|
||||
u'Edit Custom Slides'))
|
||||
self.UpButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm'
|
||||
u'CustomPlugin.EditCustomForm',
|
||||
u'Move slide Up 1'))
|
||||
self.DownButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Move slide down 1'))
|
||||
self.TitleLabel.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Title:'))
|
||||
self.AddButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Add New'))
|
||||
self.AddButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm',
|
||||
u'Add new slide at bottom'))
|
||||
self.EditButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Edit'))
|
||||
self.EditButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Edit selected slide'))
|
||||
self.EditAllButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Edit All'))
|
||||
self.EditAllButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Edit all slides'))
|
||||
self.SaveButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Save'))
|
||||
self.SaveButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Replace edited slide'))
|
||||
self.DeleteButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Delete'))
|
||||
self.DeleteButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Delete selected slide'))
|
||||
self.ClearButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Clear'))
|
||||
self.ClearButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Clear edit area'))
|
||||
self.SplitButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Split Slide'))
|
||||
self.SplitButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Add slide split'))
|
||||
self.ThemeLabel.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Theme:'))
|
||||
self.CreditLabel.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Credits:'))
|
||||
|
@ -47,7 +47,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
self.setupUi(self)
|
||||
# Connecting signals and slots
|
||||
self.previewButton = QtGui.QPushButton()
|
||||
self.previewButton.setText(translate('editCustomForm','Save && Preview'))
|
||||
self.previewButton.setText(translate(u'CustomPlugin.EditCustomForm',
|
||||
u'Save && Preview'))
|
||||
self.buttonBox.addButton(
|
||||
self.previewButton, QtGui.QDialogButtonBox.ActionRole)
|
||||
QtCore.QObject.connect(self.buttonBox,
|
||||
@ -84,7 +85,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
|
||||
def onPreview(self, button):
|
||||
log.debug(u'onPreview')
|
||||
if button.text() == unicode(translate('editCustomForm','Save && Preview')) \
|
||||
if button.text() == unicode(translate(u'CustomPlugin.EditCustomForm',
|
||||
u'Save && Preview')) \
|
||||
and self.saveCustom():
|
||||
Receiver.send_message(u'custom_preview')
|
||||
|
||||
@ -147,7 +149,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
def saveCustom(self):
|
||||
valid, message = self._validate()
|
||||
if not valid:
|
||||
QtGui.QMessageBox.critical(self, translate('editCustomForm','Error'), message,
|
||||
QtGui.QMessageBox.critical(self,
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Error'), message,
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||
return False
|
||||
sxml = SongXMLBuilder()
|
||||
@ -263,12 +266,15 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
def _validate(self):
|
||||
if len(self.TitleEdit.displayText()) == 0:
|
||||
self.TitleEdit.setFocus()
|
||||
return False, translate('editCustomForm','You need to enter a title')
|
||||
return False, translate(u'CustomPlugin.EditCustomForm',
|
||||
u'You need to enter a title')
|
||||
# must have 1 slide
|
||||
if self.VerseListView.count() == 0:
|
||||
self.VerseTextEdit.setFocus()
|
||||
return False, translate('editCustomForm','You need to enter a slide')
|
||||
return False, translate(u'CustomPlugin.EditCustomForm',
|
||||
u'You need to enter a slide')
|
||||
if self.VerseTextEdit.toPlainText():
|
||||
self.VerseTextEdit.setFocus()
|
||||
return False, translate('editCustomForm','You have unsaved data, please save or clear')
|
||||
return False, translate(u'CustomPlugin.editCustomForm',
|
||||
u'You have unsaved data, please save or clear')
|
||||
return True, u''
|
||||
|
@ -36,7 +36,7 @@ class CustomTab(SettingsTab):
|
||||
|
||||
def setupUi(self):
|
||||
self.setObjectName(u'CustomTab')
|
||||
self.tabTitleVisible = translate('CustomTab','Custom')
|
||||
self.tabTitleVisible = translate(u'CustomPlugin.CustomTab', u'Custom')
|
||||
self.CustomLayout = QtGui.QFormLayout(self)
|
||||
self.CustomLayout.setObjectName(u'CustomLayout')
|
||||
self.CustomModeGroupBox = QtGui.QGroupBox(self)
|
||||
@ -55,9 +55,10 @@ class CustomTab(SettingsTab):
|
||||
self.onDisplayFooterCheckBoxChanged)
|
||||
|
||||
def retranslateUi(self):
|
||||
self.CustomModeGroupBox.setTitle(translate('CustomTab','Custom Display'))
|
||||
self.CustomModeGroupBox.setTitle(translate(u'CustomPlugin.CustomTab',
|
||||
u'Custom Display'))
|
||||
self.DisplayFooterCheckBox.setText(
|
||||
translate('CustomTab','Display Footer'))
|
||||
translate(u'CustomPlugin.CustomTab', u'Display Footer'))
|
||||
|
||||
def onDisplayFooterCheckBoxChanged(self, check_state):
|
||||
self.displayFooter = False
|
||||
|
@ -66,7 +66,7 @@ class CustomMediaItem(MediaManagerItem):
|
||||
QtCore.SIGNAL(u'custom_preview'), self.onPreviewClick)
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate('mediaItem','Custom')
|
||||
self.PluginNameVisible = translate(u'CustomPlugin.MediaItem', u'Custom')
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
|
@ -56,11 +56,12 @@ class ImagePlugin(Plugin):
|
||||
return ImageMediaItem(self, self.icon, self.name)
|
||||
|
||||
def about(self):
|
||||
about_text = translate('ImagePlugin','<b>Image Plugin</b><br>Allows images of '
|
||||
'all types to be displayed. If a number of images are selected '
|
||||
'together and presented on the live controller it is possible '
|
||||
'to turn them into a timed loop.<br<br>From the plugin if the '
|
||||
'<i>Override background</i> is chosen and an image is selected '
|
||||
'any songs which are rendered will use the selected image from '
|
||||
'the background instead of the one provied by the theme.<br>')
|
||||
about_text = translate(u'ImagePlugin.ImagePlugin', u'<b>Image Plugin'
|
||||
u'</b><br>Allows images of all types to be displayed. If a number '
|
||||
u'of images are selected together and presented on the live '
|
||||
u'controller it is possible to turn them into a timed loop.<br<br>'
|
||||
u'From the plugin if the <i>Override background</i> is chosen and '
|
||||
u'an image is selected any songs which are rendered will use the '
|
||||
u'selected image from the background instead of the one provied by '
|
||||
u'the theme.<br>')
|
||||
return about_text
|
||||
|
@ -36,7 +36,7 @@ class ImageTab(SettingsTab):
|
||||
|
||||
def setupUi(self):
|
||||
self.setObjectName(u'ImageTab')
|
||||
self.tabTitleVisible = translate('ImageTab','Images')
|
||||
self.tabTitleVisible = translate(u'ImagePlugin.ImageTab', u'Images')
|
||||
self.ImageLayout = QtGui.QFormLayout(self)
|
||||
self.ImageLayout.setObjectName(u'ImageLayout')
|
||||
self.ImageSettingsGroupBox = QtGui.QGroupBox(self)
|
||||
@ -63,9 +63,12 @@ class ImageTab(SettingsTab):
|
||||
QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged)
|
||||
|
||||
def retranslateUi(self):
|
||||
self.ImageSettingsGroupBox.setTitle(translate('ImageTab','Image Settings'))
|
||||
self.TimeoutLabel.setText(translate('ImageTab','Slide Loop Delay:'))
|
||||
self.TimeoutSpinBox.setSuffix(translate('ImageTab','sec'))
|
||||
self.ImageSettingsGroupBox.setTitle(
|
||||
translate(u'ImagePlugin.ImageTab', u'Image Settings'))
|
||||
self.TimeoutLabel.setText(
|
||||
translate(u'ImagePlugin.ImageTab', u'Slide Loop Delay:'))
|
||||
self.TimeoutSpinBox.setSuffix(
|
||||
translate(u'ImagePlugin.ImageTab', u'sec'))
|
||||
|
||||
def onTimeoutSpinBoxChanged(self):
|
||||
self.loop_delay = self.TimeoutSpinBox.value()
|
||||
|
@ -56,12 +56,13 @@ class ImageMediaItem(MediaManagerItem):
|
||||
MediaManagerItem.__init__(self, parent, icon, title)
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate('MediaItem','Image')
|
||||
self.PluginNameVisible = translate(u'ImagePlugin.MediaItem', u'Image')
|
||||
|
||||
def retranslateUi(self):
|
||||
self.OnNewPrompt = translate('MediaItem','Select Image(s)')
|
||||
self.OnNewFileMasks = translate('MediaItem',
|
||||
'Images (*.jpg *.jpeg *.gif *.png *.bmp);; All files (*)')
|
||||
self.OnNewPrompt = translate(u'ImagePlugin.MediaItem',
|
||||
u'Select Image(s)')
|
||||
self.OnNewFileMasks = translate(u'ImagePlugin.MediaItem',
|
||||
u'Images (*.jpg *.jpeg *.gif *.png *.bmp);; All files (*)')
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
@ -90,7 +91,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
self.ListView.addAction(
|
||||
contextMenuAction(
|
||||
self.ListView, u':/slides/slide_blank.png',
|
||||
translate('MediaItem','Replace Live Background'),
|
||||
translate(u'ImagePlugin.MediaItem', u'Replace Live Background'),
|
||||
self.onReplaceClick))
|
||||
|
||||
def addEndHeaderBar(self):
|
||||
@ -105,7 +106,8 @@ class ImageMediaItem(MediaManagerItem):
|
||||
self.ImageWidget.setObjectName(u'ImageWidget')
|
||||
self.blankButton = self.Toolbar.addToolbarButton(
|
||||
u'Replace Background', u':/slides/slide_blank.png',
|
||||
translate('MediaItem','Replace Live Background'), self.onReplaceClick, False)
|
||||
translate(u'ImagePlugin.MediaItem', u'Replace Live Background'),
|
||||
self.onReplaceClick, False)
|
||||
# Add the song widget to the page layout
|
||||
self.PageLayout.addWidget(self.ImageWidget)
|
||||
|
||||
@ -143,7 +145,8 @@ class ImageMediaItem(MediaManagerItem):
|
||||
def generateSlideData(self, service_item, item=None):
|
||||
items = self.ListView.selectedIndexes()
|
||||
if items:
|
||||
service_item.title = unicode(translate('MediaItem','Image(s)'))
|
||||
service_item.title = unicode(
|
||||
translate(u'ImagePlugin.MediaItem', u'Image(s)'))
|
||||
service_item.add_capability(ItemCapabilities.AllowsMaintain)
|
||||
service_item.add_capability(ItemCapabilities.AllowsPreview)
|
||||
service_item.add_capability(ItemCapabilities.AllowsLoop)
|
||||
@ -161,8 +164,8 @@ class ImageMediaItem(MediaManagerItem):
|
||||
def onReplaceClick(self):
|
||||
if not self.ListView.selectedIndexes():
|
||||
QtGui.QMessageBox.information(self,
|
||||
translate('MediaItem','No item selected'),
|
||||
translate('MediaItem','You must select one item'))
|
||||
translate(u'ImagePlugin.MediaItem', u'No item selected'),
|
||||
translate(u'ImagePlugin.MediaItem', u'You must select one item'))
|
||||
items = self.ListView.selectedIndexes()
|
||||
for item in items:
|
||||
bitem = self.ListView.item(item.row())
|
||||
|
Loading…
Reference in New Issue
Block a user