add translation code for MediaDocks and PluginList

This commit is contained in:
rimach 2010-09-04 00:51:28 +02:00
parent 1275fdb35a
commit 95ffc8dd3b
32 changed files with 12741 additions and 7153 deletions

View File

@ -63,14 +63,6 @@ class MediaManagerItem(QtGui.QWidget):
When creating a descendant class from this class for your plugin, When creating a descendant class from this class for your plugin,
the following member variables should be set. the following member variables should be set.
``self.PluginNameShort``
The shortened (usually singular) name for the plugin e.g. *'Song'*
for the Songs plugin.
``self.pluginNameVisible``
The user visible name for a plugin which should use a suitable
translation function.
``self.OnNewPrompt`` ``self.OnNewPrompt``
Defaults to *'Select Image(s)'*. Defaults to *'Select Image(s)'*.
@ -99,7 +91,7 @@ class MediaManagerItem(QtGui.QWidget):
""" """
QtGui.QWidget.__init__(self) QtGui.QWidget.__init__(self)
self.parent = parent self.parent = parent
self.settingsSection = title.lower() self.settingsSection = parent.get_text('name_lower')
if isinstance(icon, QtGui.QIcon): if isinstance(icon, QtGui.QIcon):
self.icon = icon self.icon = icon
elif isinstance(icon, basestring): elif isinstance(icon, basestring):
@ -108,7 +100,7 @@ class MediaManagerItem(QtGui.QWidget):
else: else:
self.icon = None self.icon = None
if title: if title:
self.title = title self.title = parent.get_text('name_more')
self.toolbar = None self.toolbar = None
self.remoteTriggered = None self.remoteTriggered = None
self.serviceItemIconName = None self.serviceItemIconName = None
@ -210,62 +202,55 @@ class MediaManagerItem(QtGui.QWidget):
if self.hasImportIcon: if self.hasImportIcon:
self.addToolbarButton( self.addToolbarButton(
unicode(translate('OpenLP.MediaManagerItem', 'Import %s')) % unicode(translate('OpenLP.MediaManagerItem', 'Import %s')) %
self.PluginNameShort, self.parent.name,
unicode(translate('OpenLP.MediaManagerItem', 'Import a %s')) % unicode(self.parent.get_text('import')),
self.pluginNameVisible,
u':/general/general_import.png', self.onImportClick) u':/general/general_import.png', self.onImportClick)
## File Button ## ## File Button ##
if self.hasFileIcon: if self.hasFileIcon:
self.addToolbarButton( self.addToolbarButton(
unicode(translate('OpenLP.MediaManagerItem', 'Load %s')) % unicode(translate('OpenLP.MediaManagerItem', 'Load %s')) %
self.PluginNameShort, self.parent.name,
unicode(translate('OpenLP.MediaManagerItem', 'Load a new %s')) % unicode(self.parent.get_text('load')),
self.pluginNameVisible,
u':/general/general_open.png', self.onFileClick) u':/general/general_open.png', self.onFileClick)
## New Button ## ## New Button ##
if self.hasNewIcon: if self.hasNewIcon:
self.addToolbarButton( self.addToolbarButton(
unicode(translate('OpenLP.MediaManagerItem', 'New %s')) % unicode(translate('OpenLP.MediaManagerItem', 'New %s')) %
self.PluginNameShort, self.parent.name,
unicode(translate('OpenLP.MediaManagerItem', 'Add a new %s')) % unicode(self.parent.get_text('new')),
self.pluginNameVisible,
u':/general/general_new.png', self.onNewClick) u':/general/general_new.png', self.onNewClick)
## Edit Button ## ## Edit Button ##
if self.hasEditIcon: if self.hasEditIcon:
self.addToolbarButton( self.addToolbarButton(
unicode(translate('OpenLP.MediaManagerItem', 'Edit %s')) % unicode(translate('OpenLP.MediaManagerItem', 'Edit %s')) %
self.PluginNameShort, self.parent.name,
unicode(translate( unicode(self.parent.get_text('edit')),
'OpenLP.MediaManagerItem', 'Edit the selected %s')) %
self.pluginNameVisible,
u':/general/general_edit.png', self.onEditClick) u':/general/general_edit.png', self.onEditClick)
## Delete Button ## ## Delete Button ##
if self.hasDeleteIcon: if self.hasDeleteIcon:
self.addToolbarButton( self.addToolbarButton(
unicode(translate('OpenLP.MediaManagerItem', 'Delete %s')) % unicode(translate('OpenLP.MediaManagerItem', 'Delete %s')) %
self.PluginNameShort, self.parent.name,
translate('OpenLP.MediaManagerItem', unicode(self.parent.get_text('delete')),
'Delete the selected item'),
u':/general/general_delete.png', self.onDeleteClick) u':/general/general_delete.png', self.onDeleteClick)
## Separator Line ## ## Separator Line ##
self.addToolbarSeparator() self.addToolbarSeparator()
## Preview ## ## Preview ##
self.addToolbarButton( self.addToolbarButton(
unicode(translate('OpenLP.MediaManagerItem', 'Preview %s')) % unicode(translate('OpenLP.MediaManagerItem', 'Preview %s')) %
self.PluginNameShort, self.parent.name,
translate('OpenLP.MediaManagerItem', 'Preview the selected item'), unicode(self.parent.get_text('preview')),
u':/general/general_preview.png', self.onPreviewClick) u':/general/general_preview.png', self.onPreviewClick)
## Live Button ## ## Live Button ##
self.addToolbarButton( self.addToolbarButton(
u'Go Live', unicode(translate('OpenLP.MediaManagerItem', u'Go Live')),
translate('OpenLP.MediaManagerItem', 'Send the selected item live'), unicode(self.parent.get_text('live')),
u':/general/general_live.png', self.onLiveClick) u':/general/general_live.png', self.onLiveClick)
## Add to service Button ## ## Add to service Button ##
self.addToolbarButton( self.addToolbarButton(
unicode(translate('OpenLP.MediaManagerItem', 'Add %s to Service')) % unicode(translate('OpenLP.MediaManagerItem', 'Add %s to Service')) %
self.PluginNameShort, self.parent.name,
translate('OpenLP.MediaManagerItem', unicode(self.parent.get_text('service')),
'Add the selected item(s) to the service'),
u':/general/general_add.png', self.onAddClick) u':/general/general_add.png', self.onAddClick)
def addListViewToToolBar(self): def addListViewToToolBar(self):
@ -281,7 +266,7 @@ class MediaManagerItem(QtGui.QWidget):
QtGui.QAbstractItemView.ExtendedSelection) QtGui.QAbstractItemView.ExtendedSelection)
self.listView.setAlternatingRowColors(True) self.listView.setAlternatingRowColors(True)
self.listView.setDragEnabled(True) self.listView.setDragEnabled(True)
self.listView.setObjectName(u'%sListView' % self.PluginNameShort) self.listView.setObjectName(u'%sListView' % self.parent.name)
#Add to pageLayout #Add to pageLayout
self.pageLayout.addWidget(self.listView) self.pageLayout.addWidget(self.listView)
#define and add the context menu #define and add the context menu
@ -291,7 +276,7 @@ class MediaManagerItem(QtGui.QWidget):
context_menu_action( context_menu_action(
self.listView, u':/general/general_edit.png', self.listView, u':/general/general_edit.png',
unicode(translate('OpenLP.MediaManagerItem', '&Edit %s')) % unicode(translate('OpenLP.MediaManagerItem', '&Edit %s')) %
self.pluginNameVisible, self.parent.name,
self.onEditClick)) self.onEditClick))
self.listView.addAction(context_menu_separator(self.listView)) self.listView.addAction(context_menu_separator(self.listView))
if self.hasDeleteIcon: if self.hasDeleteIcon:
@ -300,14 +285,14 @@ class MediaManagerItem(QtGui.QWidget):
self.listView, u':/general/general_delete.png', self.listView, u':/general/general_delete.png',
unicode(translate('OpenLP.MediaManagerItem', unicode(translate('OpenLP.MediaManagerItem',
'&Delete %s')) % '&Delete %s')) %
self.pluginNameVisible, self.parent.name,
self.onDeleteClick)) self.onDeleteClick))
self.listView.addAction(context_menu_separator(self.listView)) self.listView.addAction(context_menu_separator(self.listView))
self.listView.addAction( self.listView.addAction(
context_menu_action( context_menu_action(
self.listView, u':/general/general_preview.png', self.listView, u':/general/general_preview.png',
unicode(translate('OpenLP.MediaManagerItem', '&Preview %s')) % unicode(translate('OpenLP.MediaManagerItem', '&Preview %s')) %
self.pluginNameVisible, self.parent.name,
self.onPreviewClick)) self.onPreviewClick))
self.listView.addAction( self.listView.addAction(
context_menu_action( context_menu_action(
@ -447,7 +432,7 @@ class MediaManagerItem(QtGui.QWidget):
translate('OpenLP.MediaManagerItem', translate('OpenLP.MediaManagerItem',
'You must select one or more items to preview.')) 'You must select one or more items to preview.'))
else: else:
log.debug(self.PluginNameShort + u' Preview requested') log.debug(self.parent.name + u' Preview requested')
service_item = self.buildServiceItem() service_item = self.buildServiceItem()
if service_item: if service_item:
service_item.from_plugin = True service_item.from_plugin = True
@ -464,7 +449,7 @@ class MediaManagerItem(QtGui.QWidget):
translate('OpenLP.MediaManagerItem', translate('OpenLP.MediaManagerItem',
'You must select one or more items to send live.')) 'You must select one or more items to send live.'))
else: else:
log.debug(self.PluginNameShort + u' Live requested') log.debug(self.parent.name + u' Live requested')
service_item = self.buildServiceItem() service_item = self.buildServiceItem()
if service_item: if service_item:
service_item.from_plugin = True service_item.from_plugin = True
@ -483,7 +468,7 @@ class MediaManagerItem(QtGui.QWidget):
#Is it posssible to process multiple list items to generate multiple #Is it posssible to process multiple list items to generate multiple
#service items? #service items?
if self.singleServiceItem or self.remoteTriggered: if self.singleServiceItem or self.remoteTriggered:
log.debug(self.PluginNameShort + u' Add requested') log.debug(self.parent.name + u' Add requested')
service_item = self.buildServiceItem() service_item = self.buildServiceItem()
if service_item: if service_item:
service_item.from_plugin = False service_item.from_plugin = False
@ -507,7 +492,7 @@ class MediaManagerItem(QtGui.QWidget):
translate('OpenLP.MediaManagerItem', translate('OpenLP.MediaManagerItem',
'You must select one or more items')) 'You must select one or more items'))
else: else:
log.debug(self.PluginNameShort + u' Add requested') log.debug(self.parent.name + u' Add requested')
service_item = self.parent.serviceManager.getServiceItem() service_item = self.parent.serviceManager.getServiceItem()
if not service_item: if not service_item:
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,

View File

@ -289,3 +289,18 @@ class Plugin(QtCore.QObject):
The new name the plugin should now use. The new name the plugin should now use.
""" """
pass pass
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
pass
self.text = {}
def get_text(self, content):
"""
Called to retrieve a translated piece of text for menues, context menues, ...
"""
if self.text.has_key(content):
return self.text[content]
else:
return self.name

View File

@ -41,7 +41,7 @@ class SettingsTab(QtGui.QWidget):
QtGui.QWidget.__init__(self) QtGui.QWidget.__init__(self)
self.tabTitle = title self.tabTitle = title
self.tabTitleVisible = None self.tabTitleVisible = None
self.settingsSection = self.tabTitle.lower() self.settingsSection = self.tabTitle
self.setupUi() self.setupUi()
self.retranslateUi() self.retranslateUi()
self.initialise() self.initialise()

View File

@ -61,7 +61,7 @@ class MediaDockManager(object):
match = False match = False
for dock_index in range(0, self.media_dock.count()): for dock_index in range(0, self.media_dock.count()):
if self.media_dock.widget(dock_index).settingsSection == \ if self.media_dock.widget(dock_index).settingsSection == \
media_item.title.lower(): media_item.parent.get_text('name_lower'):
match = True match = True
break break
if not match: if not match:
@ -77,7 +77,8 @@ class MediaDockManager(object):
log.debug(u'remove %s dock' % name) log.debug(u'remove %s dock' % name)
for dock_index in range(0, self.media_dock.count()): for dock_index in range(0, self.media_dock.count()):
if self.media_dock.widget(dock_index): if self.media_dock.widget(dock_index):
log.debug(u'%s %s' % (name, self.media_dock.widget(dock_index).settingsSection))
if self.media_dock.widget(dock_index).settingsSection == \ if self.media_dock.widget(dock_index).settingsSection == \
name.lower(): name:
self.media_dock.widget(dock_index).hide() self.media_dock.widget(dock_index).hide()
self.media_dock.removeItem(dock_index) self.media_dock.removeItem(dock_index)

View File

@ -75,7 +75,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
elif plugin.status == PluginStatus.Disabled: elif plugin.status == PluginStatus.Disabled:
status_text = unicode( status_text = unicode(
translate('OpenLP.PluginForm', '%s (Disabled)')) translate('OpenLP.PluginForm', '%s (Disabled)'))
item.setText(status_text % plugin.name) item.setText(status_text % plugin.get_text('name_more'))
# If the plugin has an icon, set it! # If the plugin has an icon, set it!
if plugin.icon: if plugin.icon:
item.setIcon(plugin.icon) item.setIcon(plugin.icon)
@ -103,10 +103,10 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
if self.pluginListWidget.currentItem() is None: if self.pluginListWidget.currentItem() is None:
self._clearDetails() self._clearDetails()
return return
plugin_name = self.pluginListWidget.currentItem().text().split(u' ')[0] plugin_name_more = self.pluginListWidget.currentItem().text().split(u' ')[0]
self.activePlugin = None self.activePlugin = None
for plugin in self.parent.plugin_manager.plugins: for plugin in self.parent.plugin_manager.plugins:
if plugin.name == plugin_name: if plugin.get_text('name_more') == plugin_name_more:
self.activePlugin = plugin self.activePlugin = plugin
break break
if self.activePlugin: if self.activePlugin:
@ -135,4 +135,4 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
status_text = unicode( status_text = unicode(
translate('OpenLP.PluginForm', '%s (Disabled)')) translate('OpenLP.PluginForm', '%s (Disabled)'))
self.pluginListWidget.currentItem().setText( self.pluginListWidget.currentItem().setText(
status_text % self.activePlugin.name) status_text % self.activePlugin.get_text('name_more'))

View File

@ -40,6 +40,7 @@ class AlertsPlugin(Plugin):
log.info(u'Alerts Plugin loaded') log.info(u'Alerts Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
self.set_plugin_translations()
Plugin.__init__(self, u'Alerts', u'1.9.2', plugin_helpers) Plugin.__init__(self, u'Alerts', u'1.9.2', plugin_helpers)
self.weight = -3 self.weight = -3
self.icon = build_icon(u':/plugins/plugin_alerts.png') self.icon = build_icon(u':/plugins/plugin_alerts.png')
@ -101,3 +102,31 @@ class AlertsPlugin(Plugin):
'<br />The alert plugin controls the displaying of nursery alerts ' '<br />The alert plugin controls the displaying of nursery alerts '
'on the display screen') 'on the display screen')
return about_text return about_text
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Alerts'
self.name_lower = u'alerts'
self.text = {}
# for context menu
# elf.text['context_edit'] = translate('AlertsPlugin', '&Edit Song')
# elf.text['context_delete'] = translate('AlertsPlugin', '&Delete Song')
# elf.text['context_preview'] = translate('AlertsPlugin', '&Preview Song')
# elf.text['context_live'] = translate('AlertsPlugin', '&Show Live')
# # forHeaders in mediamanagerdock
# elf.text['import'] = translate('AlertsPlugin', 'Import a Song')
# elf.text['file'] = translate('AlertsPlugin', 'Load a new Song')
# elf.text['new'] = translate('AlertsPlugin', 'Add a new Song')
# elf.text['edit'] = translate('AlertsPlugin', 'Edit the selected Song')
# elf.text['delete'] = translate('AlertsPlugin', 'Delete the selected Song')
# elf.text['delete_more'] = translate('AlertsPlugin', 'Delete the selected Songs')
# elf.text['preview'] = translate('AlertsPlugin', 'Preview the selected Song')
# elf.text['preview_more'] = translate('AlertsPlugin', 'Preview the selected Songs')
# elf.text['live'] = translate('AlertsPlugin', 'Send the selected Song live')
# elf.text['live_more'] = translate('AlertsPlugin', 'Send the selected Songs live')
# elf.text['service'] = translate('AlertsPlugin', 'Add the selected Song to the service')
# elf.text['service_more'] = translate('AlertsPlugin', 'Add the selected Songs to the service')
# # for names in mediamanagerdock and pluginlist
self.text['name'] = translate('AlertsPlugin', 'Alert')
self.text['name_more'] = translate('AlertsPlugin', 'Alerts')

View File

@ -37,6 +37,7 @@ class BiblePlugin(Plugin):
log.info(u'Bible Plugin loaded') log.info(u'Bible Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
self.set_plugin_translations()
Plugin.__init__(self, u'Bibles', u'1.9.2', plugin_helpers) Plugin.__init__(self, u'Bibles', u'1.9.2', plugin_helpers)
self.weight = -9 self.weight = -9
self.icon_path = u':/plugins/plugin_bibles.png' self.icon_path = u':/plugins/plugin_bibles.png'
@ -116,3 +117,31 @@ class BiblePlugin(Plugin):
The new name the plugin should now use. The new name the plugin should now use.
""" """
self.settings_tab.bible_theme = newTheme self.settings_tab.bible_theme = newTheme
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Bibles'
self.name_lower = u'bibles'
self.text = {}
#for context menu
self.text['context_edit'] = translate('BiblesPlugin', '&Edit Bible')
self.text['context_delete'] = translate('BiblesPlugin', '&Delete Bible')
self.text['context_preview'] = translate('BiblesPlugin', '&Preview Bible')
self.text['context_live'] = translate('BiblesPlugin', '&Show Live')
# forHeaders in mediamanagerdock
self.text['import'] = translate('BiblesPlugin', 'Import a Bible')
self.text['load'] = translate('BiblesPlugin', 'Load a new Bible')
self.text['new'] = translate('BiblesPlugin', 'Add a new Bible')
self.text['edit'] = translate('BiblesPlugin', 'Edit the selected Bible')
self.text['delete'] = translate('BiblesPlugin', 'Delete the selected Bible')
self.text['delete_more'] = translate('BiblesPlugin', 'Delete the selected Bibles')
self.text['preview'] = translate('BiblesPlugin', 'Preview the selected Bible')
self.text['preview_more'] = translate('BiblesPlugin', 'Preview the selected Bibles')
self.text['live'] = translate('BiblesPlugin', 'Send the selected Bible live')
self.text['live_more'] = translate('BiblesPlugin', 'Send the selected Bibles live')
self.text['service'] = translate('BiblesPlugin', 'Add the selected Verse to the service')
self.text['service_more'] = translate('BiblesPlugin', 'Add the selected Verses to the service')
# for names in mediamanagerdock and pluginlist
self.text['name'] = translate('BiblesPlugin', 'Bible')
self.text['name_more'] = translate('BiblesPlugin', 'Bibles')

View File

@ -54,8 +54,6 @@ class BibleMediaItem(MediaManagerItem):
log.info(u'Bible Media Item loaded') log.info(u'Bible Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.PluginNameShort = u'Bible'
self.pluginNameVisible = translate('BiblesPlugin.MediaItem', 'Bible')
self.IconPath = u'songs/song' self.IconPath = u'songs/song'
self.ListViewWithDnD_class = BibleListView self.ListViewWithDnD_class = BibleListView
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, icon, title)

View File

@ -47,6 +47,7 @@ class CustomPlugin(Plugin):
log.info(u'Custom Plugin loaded') log.info(u'Custom Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
self.set_plugin_translations()
Plugin.__init__(self, u'Custom', u'1.9.2', plugin_helpers) Plugin.__init__(self, u'Custom', u'1.9.2', plugin_helpers)
self.weight = -5 self.weight = -5
self.custommanager = Manager(u'custom', init_schema) self.custommanager = Manager(u'custom', init_schema)
@ -96,3 +97,31 @@ class CustomPlugin(Plugin):
for custom in customsUsingTheme: for custom in customsUsingTheme:
custom.theme_name = newTheme custom.theme_name = newTheme
self.custommanager.save_object(custom) self.custommanager.save_object(custom)
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Custom'
self.name_lower = u'custom'
self.text = {}
#for context menu
self.text['context_edit'] = translate('CustomsPlugin', '&Edit Custom')
self.text['context_delete'] = translate('CustomsPlugin', '&Delete Custom')
self.text['context_preview'] = translate('CustomsPlugin', '&Preview Custom')
self.text['context_live'] = translate('CustomsPlugin', '&Show Live')
# forHeaders in mediamanagerdock
self.text['import'] = translate('CustomsPlugin', 'Import a Custom')
self.text['load'] = translate('CustomsPlugin', 'Load a new Custom')
self.text['new'] = translate('CustomsPlugin', 'Add a new Custom')
self.text['edit'] = translate('CustomsPlugin', 'Edit the selected Custom')
self.text['delete'] = translate('CustomsPlugin', 'Delete the selected Custom')
self.text['delete_more'] = translate('CustomsPlugin', 'Delete the selected Custom')
self.text['preview'] = translate('CustomsPlugin', 'Preview the selected Custom')
self.text['preview_more'] = translate('CustomsPlugin', 'Preview the selected Custom')
self.text['live'] = translate('CustomsPlugin', 'Send the selected Custom live')
self.text['live_more'] = translate('CustomsPlugin', 'Send the selected Custom live')
self.text['service'] = translate('CustomsPlugin', 'Add the selected Custom to the service')
self.text['service_more'] = translate('CustomsPlugin', 'Add the selected Custom to the service')
# for names in mediamanagerdock and pluginlist
self.text['name'] = translate('CustomsPlugin', 'Custom')
self.text['name_more'] = translate('CustomsPlugin', 'Custom')

View File

@ -47,8 +47,6 @@ class CustomMediaItem(MediaManagerItem):
log.info(u'Custom Media Item loaded') log.info(u'Custom Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.PluginNameShort = u'Custom'
self.pluginNameVisible = translate('CustomPlugin.MediaItem', 'Custom')
self.IconPath = u'custom/custom' self.IconPath = u'custom/custom'
# this next is a class, not an instance of a class - it will # this next is a class, not an instance of a class - it will
# be instanced by the base MediaManagerItem # be instanced by the base MediaManagerItem

View File

@ -35,6 +35,7 @@ class ImagePlugin(Plugin):
log.info(u'Image Plugin loaded') log.info(u'Image Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
self.set_plugin_translations()
Plugin.__init__(self, u'Images', u'1.9.2', plugin_helpers) Plugin.__init__(self, u'Images', u'1.9.2', plugin_helpers)
self.weight = -7 self.weight = -7
self.icon_path = u':/plugins/plugin_images.png' self.icon_path = u':/plugins/plugin_images.png'
@ -57,3 +58,32 @@ class ImagePlugin(Plugin):
'selected image as a background instead of the background ' 'selected image as a background instead of the background '
'provided by the theme.') 'provided by the theme.')
return about_text return about_text
# rimach
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Images'
self.name_lower = u'images'
self.text = {}
#for context menu
self.text['context_edit'] = translate('ImagePlugin', '&Edit Image')
self.text['context_delete'] = translate('ImagePlugin', '&Delete Image')
self.text['context_preview'] = translate('ImagePlugin', '&Preview Image')
self.text['context_live'] = translate('ImagePlugin', '&Show Live')
# forHeaders in mediamanagerdock
self.text['import'] = translate('ImagePlugin', 'Import a Image')
self.text['load'] = translate('ImagePlugin', 'Load a new Image')
self.text['new'] = translate('ImagePlugin', 'Add a new Image')
self.text['edit'] = translate('ImagePlugin', 'Edit the selected Image')
self.text['delete'] = translate('ImagePlugin', 'Delete the selected Image')
self.text['delete_more'] = translate('ImagePlugin', 'Delete the selected Images')
self.text['preview'] = translate('ImagePlugin', 'Preview the selected Image')
self.text['preview_more'] = translate('ImagePlugin', 'Preview the selected Images')
self.text['live'] = translate('ImagePlugin', 'Send the selected Image live')
self.text['live_more'] = translate('ImagePlugin', 'Send the selected Images live')
self.text['service'] = translate('ImagePlugin', 'Add the selected Image to the service')
self.text['service_more'] = translate('ImagePlugin', 'Add the selected Images to the service')
# for names in mediamanagerdock and pluginlist
self.text['name'] = translate('ImagePlugin', 'Image')
self.text['name_more'] = translate('ImagePlugin', 'Images')

View File

@ -50,8 +50,6 @@ class ImageMediaItem(MediaManagerItem):
log.info(u'Image Media Item loaded') log.info(u'Image Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.PluginNameShort = u'Image'
self.pluginNameVisible = translate('ImagePlugin.MediaItem', 'Image')
self.IconPath = u'images/image' self.IconPath = u'images/image'
# this next is a class, not an instance of a class - it will # this next is a class, not an instance of a class - it will
# be instanced by the base MediaManagerItem # be instanced by the base MediaManagerItem

View File

@ -47,8 +47,6 @@ class MediaMediaItem(MediaManagerItem):
log.info(u'%s MediaMediaItem loaded', __name__) log.info(u'%s MediaMediaItem loaded', __name__)
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.PluginNameShort = u'Media'
self.pluginNameVisible = translate('MediaPlugin.MediaItem', 'Media')
self.IconPath = u'images/image' self.IconPath = u'images/image'
self.background = False self.background = False
# this next is a class, not an instance of a class - it will # this next is a class, not an instance of a class - it will

View File

@ -37,6 +37,7 @@ class MediaPlugin(Plugin):
log.info(u'%s MediaPlugin loaded', __name__) log.info(u'%s MediaPlugin loaded', __name__)
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
self.set_plugin_translations()
Plugin.__init__(self, u'Media', u'1.9.2', plugin_helpers) Plugin.__init__(self, u'Media', u'1.9.2', plugin_helpers)
self.weight = -6 self.weight = -6
self.icon_path = u':/plugins/plugin_media.png' self.icon_path = u':/plugins/plugin_media.png'
@ -76,3 +77,31 @@ class MediaPlugin(Plugin):
about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>' about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>'
'<br />The media plugin provides playback of audio and video.') '<br />The media plugin provides playback of audio and video.')
return about_text return about_text
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Media'
self.name_lower = u'media'
self.text = {}
#for context menu
self.text['context_edit'] = translate('MediaPlugin', '&Edit Media')
self.text['context_delete'] = translate('MediaPlugin', '&Delete Media')
self.text['context_preview'] = translate('MediaPlugin', '&Preview Media')
self.text['context_live'] = translate('MediaPlugin', '&Show Live')
# forHeaders in mediamanagerdock
self.text['import'] = translate('MediaPlugin', 'Import a Media')
self.text['load'] = translate('MediaPlugin', 'Load a new Media')
self.text['new'] = translate('MediaPlugin', 'Add a new Media')
self.text['edit'] = translate('MediaPlugin', 'Edit the selected Media')
self.text['delete'] = translate('MediaPlugin', 'Delete the selected Media')
self.text['delete_more'] = translate('MediaPlugin', 'Delete the selected Media')
self.text['preview'] = translate('MediaPlugin', 'Preview the selected Media')
self.text['preview_more'] = translate('MediaPlugin', 'Preview the selected Media')
self.text['live'] = translate('MediaPlugin', 'Send the selected Media live')
self.text['live_more'] = translate('MediaPlugin', 'Send the selected Media live')
self.text['service'] = translate('MediaPlugin', 'Add the selected Media to the service')
self.text['service_more'] = translate('MediaPlugin', 'Add the selected Media to the service')
# for names in mediamanagerdock and pluginlist
self.text['name'] = translate('MediaPlugin', 'Media')
self.text['name_more'] = translate('MediaPlugin', 'Media')

View File

@ -58,9 +58,6 @@ class PresentationMediaItem(MediaManagerItem):
Constructor. Setup defaults Constructor. Setup defaults
""" """
self.controllers = controllers self.controllers = controllers
self.PluginNameShort = u'Presentation'
self.pluginNameVisible = translate('PresentationPlugin.MediaItem',
'Presentation')
self.IconPath = u'presentations/presentation' self.IconPath = u'presentations/presentation'
self.Automatic = u'' self.Automatic = u''
# this next is a class, not an instance of a class - it will # this next is a class, not an instance of a class - it will

View File

@ -51,6 +51,7 @@ class PresentationPlugin(Plugin):
""" """
log.debug(u'Initialised') log.debug(u'Initialised')
self.controllers = {} self.controllers = {}
self.set_plugin_translations()
Plugin.__init__(self, u'Presentations', u'1.9.2', plugin_helpers) Plugin.__init__(self, u'Presentations', u'1.9.2', plugin_helpers)
self.weight = -8 self.weight = -8
self.icon_path = u':/plugins/plugin_presentations.png' self.icon_path = u':/plugins/plugin_presentations.png'
@ -143,3 +144,31 @@ class PresentationPlugin(Plugin):
'programs. The choice of available presentation programs is ' 'programs. The choice of available presentation programs is '
'available to the user in a drop down box.') 'available to the user in a drop down box.')
return about_text return about_text
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Presentations'
self.name_lower = u'presentations'
self.text = {}
#for context menu
self.text['context_edit'] = translate('PresentationPlugin', '&Edit Presentation')
self.text['context_delete'] = translate('PresentationPlugin', '&Delete Presentation')
self.text['context_preview'] = translate('PresentationPlugin', '&Preview Presentation')
self.text['context_live'] = translate('PresentationPlugin', '&Show Live')
# forHeaders in mediamanagerdock
self.text['import'] = translate('PresentationPlugin', 'Import a Presentation')
self.text['load'] = translate('PresentationPlugin', 'Load a new Presentation')
self.text['new'] = translate('PresentationPlugin', 'Add a new Presentation')
self.text['edit'] = translate('PresentationPlugin', 'Edit the selected Presentation')
self.text['delete'] = translate('PresentationPlugin', 'Delete the selected Presentation')
self.text['delete_more'] = translate('PresentationPlugin', 'Delete the selected Presentations')
self.text['preview'] = translate('PresentationPlugin', 'Preview the selected Presentation')
self.text['preview_more'] = translate('PresentationPlugin', 'Preview the selected Presentations')
self.text['live'] = translate('PresentationPlugin', 'Send the selected Presentation live')
self.text['live_more'] = translate('PresentationPlugin', 'Send the selected Presentations live')
self.text['service'] = translate('PresentationPlugin', 'Add the selected Presentation to the service')
self.text['service_more'] = translate('PresentationPlugin', 'Add the selected Presentations to the service')
# for names in mediamanagerdock and pluginlist
self.text['name'] = translate('PresentationPlugin', 'Presentation')
self.text['name_more'] = translate('PresentationPlugin', 'Presentations')

View File

@ -38,6 +38,7 @@ class RemotesPlugin(Plugin):
""" """
remotes constructor remotes constructor
""" """
self.set_plugin_translations()
Plugin.__init__(self, u'Remotes', u'1.9.2', plugin_helpers) Plugin.__init__(self, u'Remotes', u'1.9.2', plugin_helpers)
self.icon = build_icon(u':/plugins/plugin_remote.png') self.icon = build_icon(u':/plugins/plugin_remote.png')
self.weight = -1 self.weight = -1
@ -76,3 +77,32 @@ class RemotesPlugin(Plugin):
'a running version of OpenLP on a different computer via a web ' 'a running version of OpenLP on a different computer via a web '
'browser or through the remote API.') 'browser or through the remote API.')
return about_text return about_text
# rimach
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Remotes'
self.name_lower = u'remotes'
self.text = {}
#for context menu
# self.text['context_edit'] = translate('RemotePlugin', '&Edit Remotes')
# self.text['context_delete'] = translate('RemotePlugin', '&Delete Remotes')
# self.text['context_preview'] = translate('RemotePlugin', '&Preview Remotes')
# self.text['context_live'] = translate('RemotePlugin', '&Show Live')
# # forHeaders in mediamanagerdock
# self.text['import'] = translate('RemotePlugin', 'Import a Remotes')
# self.text['file'] = translate('RemotePlugin', 'Load a new Remotes')
# self.text['new'] = translate('RemotePlugin', 'Add a new Remotes')
# self.text['edit'] = translate('RemotePlugin', 'Edit the selected Remotes')
# self.text['delete'] = translate('RemotePlugin', 'Delete the selected Remotes')
# self.text['delete_more'] = translate('RemotePlugin', 'Delete the selected Remotes')
# self.text['preview'] = translate('RemotePlugin', 'Preview the selected Remotes')
# self.text['preview_more'] = translate('RemotePlugin', 'Preview the selected Remotes')
# self.text['live'] = translate('RemotePlugin', 'Send the selected Remotes live')
# self.text['live_more'] = translate('RemotePlugin', 'Send the selected Remotes live')
# self.text['service'] = translate('RemotePlugin', 'Add the selected Remotes to the service')
# self.text['service_more'] = translate('RemotePlugin', 'Add the selected Remotes to the service')
# # for names in mediamanagerdock and pluginlist
self.text['name'] = translate('RemotePlugin', 'Remote')
self.text['name_more'] = translate('RemotePlugin', 'Remotes')

View File

@ -49,8 +49,6 @@ class SongMediaItem(MediaManagerItem):
log.info(u'Song Media Item loaded') log.info(u'Song Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.PluginNameShort = u'Song'
self.pluginNameVisible = translate('SongsPlugin.MediaItem', 'Song')
self.IconPath = u'songs/song' self.IconPath = u'songs/song'
self.ListViewWithDnD_class = SongListView self.ListViewWithDnD_class = SongListView
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, icon, title)

View File

@ -50,6 +50,7 @@ class SongsPlugin(Plugin):
""" """
Create and set up the Songs plugin. Create and set up the Songs plugin.
""" """
self.set_plugin_translations()
Plugin.__init__(self, u'Songs', u'1.9.2', plugin_helpers) Plugin.__init__(self, u'Songs', u'1.9.2', plugin_helpers)
self.weight = -10 self.weight = -10
self.manager = Manager(u'songs', init_schema) self.manager = Manager(u'songs', init_schema)
@ -147,3 +148,31 @@ class SongsPlugin(Plugin):
importer = class_(self.manager, **kwargs) importer = class_(self.manager, **kwargs)
importer.register(self.mediaItem.import_wizard) importer.register(self.mediaItem.import_wizard)
return importer return importer
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Songs'
self.name_lower = u'songs'
self.text = {}
#for context menu
self.text['context_edit'] = translate('SongsPlugin', '&Edit Song')
self.text['context_delete'] = translate('SongsPlugin', '&Delete Song')
self.text['context_preview'] = translate('SongsPlugin', '&Preview Song')
self.text['context_live'] = translate('SongsPlugin', '&Show Live')
# forHeaders in mediamanagerdock
self.text['import'] = translate('SongsPlugin', 'Import a Song')
self.text['load'] = translate('SongsPlugin', 'Load a new Song')
self.text['new'] = translate('SongsPlugin', 'Add a new Song')
self.text['edit'] = translate('SongsPlugin', 'Edit the selected Song')
self.text['delete'] = translate('SongsPlugin', 'Delete the selected Song')
self.text['delete_more'] = translate('SongsPlugin', 'Delete the selected Songs')
self.text['preview'] = translate('SongsPlugin', 'Preview the selected Song')
self.text['preview_more'] = translate('SongsPlugin', 'Preview the selected Songs')
self.text['live'] = translate('SongsPlugin', 'Send the selected Song live')
self.text['live_more'] = translate('SongsPlugin', 'Send the selected Songs live')
self.text['service'] = translate('SongsPlugin', 'Add the selected Song to the service')
self.text['service_more'] = translate('SongsPlugin', 'Add the selected Songs to the service')
# for names in mediamanagerdock and pluginlist
self.text['name'] = translate('SongsPlugin', 'Song')
self.text['name_more'] = translate('SongsPlugin', 'Songs')

View File

@ -41,6 +41,7 @@ class SongUsagePlugin(Plugin):
log.info(u'SongUsage Plugin loaded') log.info(u'SongUsage Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
self.set_plugin_translations()
Plugin.__init__(self, u'SongUsage', u'1.9.2', plugin_helpers) Plugin.__init__(self, u'SongUsage', u'1.9.2', plugin_helpers)
self.weight = -4 self.weight = -4
self.icon = build_icon(u':/plugins/plugin_songusage.png') self.icon = build_icon(u':/plugins/plugin_songusage.png')
@ -162,3 +163,32 @@ class SongUsagePlugin(Plugin):
'</strong><br />This plugin tracks the usage of songs in ' '</strong><br />This plugin tracks the usage of songs in '
'services.') 'services.')
return about_text return about_text
def set_plugin_translations(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'SongUsage'
self.name_lower = u'songusage'
self.text = {}
# #for context menu
# self.text['context_edit'] = translate('SongUsagePlugin', '&Edit SongUsage')
# self.text['context_delete'] = translate('SongUsagePlugin', '&Delete SongUsage')
# self.text['context_preview'] = translate('SongUsagePlugin', '&Preview SongUsage')
# self.text['context_live'] = translate('SongUsagePlugin', '&Show Live')
# # forHeaders in mediamanagerdock
# self.text['import'] = translate('SongUsagePlugin', 'Import a SongUsage')
# self.text['file'] = translate('SongUsagePlugin', 'Load a new SongUsage')
# self.text['new'] = translate('SongUsagePlugin', 'Add a new SongUsage')
# self.text['edit'] = translate('SongUsagePlugin', 'Edit the selected SongUsage')
# self.text['delete'] = translate('SongUsagePlugin', 'Delete the selected SongUsage')
# self.text['delete_more'] = translate('SongUsagePlugin', 'Delete the selected Songs')
# self.text['preview'] = translate('SongUsagePlugin', 'Preview the selected SongUsage')
# self.text['preview_more'] = translate('SongUsagePlugin', 'Preview the selected Songs')
# self.text['live'] = translate('SongUsagePlugin', 'Send the selected SongUsage live')
# self.text['live_more'] = translate('SongUsagePlugin', 'Send the selected Songs live')
# self.text['service'] = translate('SongUsagePlugin', 'Add the selected SongUsage to the service')
# self.text['service_more'] = translate('SongUsagePlugin', 'Add the selected Songs to the service')
# for names in mediamanagerdock and pluginlist
self.text['name'] = translate('SongUsagePlugin', 'SongUsage')
self.text['name_more'] = translate('SongUsagePlugin', 'Songs')

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff