Translate string clean up

core/lib/__init__.py
core/utils/languagemanager.py
core/lib/mediamanageritem.py
core/ui/slidecontroller.py
core/ui/plugin*.py
core/ui/service*.py
This commit is contained in:
Tim Bentley 2010-06-19 05:05:39 +01:00
parent 18a32a2217
commit 41789ef5e3
8 changed files with 144 additions and 144 deletions

View File

@ -208,62 +208,62 @@ class MediaManagerItem(QtGui.QWidget):
## Import Button ## ## Import Button ##
if self.hasImportIcon: if self.hasImportIcon:
self.addToolbarButton( self.addToolbarButton(
unicode(translate(u'MediaManagerItem', u'Import %s')) % \ unicode(translate('MediaManagerItem', 'Import %s')) % \
self.PluginNameShort, self.PluginNameShort,
unicode(translate(u'MediaManagerItem', u'Import a %s')) % \ unicode(translate('MediaManagerItem', 'Import a %s')) % \
self.PluginNameVisible, 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(u'MediaManagerItem', u'Load %s')) % \ unicode(translate('MediaManagerItem', 'Load %s')) % \
self.PluginNameShort, self.PluginNameShort,
unicode(translate(u'MediaManagerItem', u'Load a new %s')) % \ unicode(translate('MediaManagerItem', 'Load a new %s')) % \
self.PluginNameVisible, 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(u'MediaManagerItem', u'New %s')) % \ unicode(translate('MediaManagerItem', 'New %s')) % \
self.PluginNameShort, self.PluginNameShort,
unicode(translate(u'MediaManagerItem', u'Add a new %s')) % \ unicode(translate('MediaManagerItem', 'Add a new %s')) % \
self.PluginNameVisible, 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(u'MediaManagerItem', u'Edit %s')) % \ unicode(translate('MediaManagerItem', 'Edit %s')) % \
self.PluginNameShort, self.PluginNameShort,
unicode(translate( unicode(translate(
u'MediaManagerItem', u'Edit the selected %s')) % \ 'MediaManagerItem', 'Edit the selected %s')) % \
self.PluginNameVisible, 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(u'MediaManagerItem', u'Delete %s')) % \ unicode(translate('MediaManagerItem', 'Delete %s')) % \
self.PluginNameShort, self.PluginNameShort,
translate(u'MediaManagerItem', u'Delete the selected item'), translate('MediaManagerItem', '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(u'MediaManagerItem', u'Preview %s')) % \ unicode(translate('MediaManagerItem', 'Preview %s')) % \
self.PluginNameShort, self.PluginNameShort,
translate(u'MediaManagerItem', u'Preview the selected item'), translate('MediaManagerItem', 'Preview the selected item'),
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', u'Go Live',
translate(u'MediaManagerItem', u'Send the selected item live'), translate('MediaManagerItem', 'Send the selected item 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(u'MediaManagerItem', u'Add %s to Service')) % \ unicode(translate('MediaManagerItem', 'Add %s to Service')) % \
self.PluginNameShort, self.PluginNameShort,
translate(u'MediaManagerItem', translate('MediaManagerItem',
u'Add the selected item(s) to the 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):
@ -285,7 +285,7 @@ class MediaManagerItem(QtGui.QWidget):
self.ListView.addAction( self.ListView.addAction(
context_menu_action( context_menu_action(
self.ListView, u':/general/general_edit.png', self.ListView, u':/general/general_edit.png',
unicode(translate(u'MediaManagerItem', u'&Edit %s')) % \ unicode(translate('MediaManagerItem', '&Edit %s')) % \
self.PluginNameVisible, self.PluginNameVisible,
self.onEditClick)) self.onEditClick))
self.ListView.addAction(context_menu_separator(self.ListView)) self.ListView.addAction(context_menu_separator(self.ListView))
@ -293,32 +293,32 @@ class MediaManagerItem(QtGui.QWidget):
self.ListView.addAction( self.ListView.addAction(
context_menu_action( context_menu_action(
self.ListView, u':/general/general_delete.png', self.ListView, u':/general/general_delete.png',
unicode(translate(u'MediaManagerItem', u'&Delete %s')) % \ unicode(translate('MediaManagerItem', '&Delete %s')) % \
self.PluginNameVisible, self.PluginNameVisible,
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(u'MediaManagerItem', u'&Preview %s')) % \ unicode(translate('MediaManagerItem', '&Preview %s')) % \
self.PluginNameVisible, self.PluginNameVisible,
self.onPreviewClick)) self.onPreviewClick))
self.ListView.addAction( self.ListView.addAction(
context_menu_action( context_menu_action(
self.ListView, u':/general/general_live.png', self.ListView, u':/general/general_live.png',
translate(u'MediaManagerItem', u'&Show Live'), translate('MediaManagerItem', '&Show Live'),
self.onLiveClick)) self.onLiveClick))
self.ListView.addAction( self.ListView.addAction(
context_menu_action( context_menu_action(
self.ListView, u':/general/general_add.png', self.ListView, u':/general/general_add.png',
translate(u'MediaManagerItem', u'&Add to Service'), translate('MediaManagerItem', '&Add to Service'),
self.onAddClick)) self.onAddClick))
if self.addToServiceItem: if self.addToServiceItem:
self.ListView.addAction( self.ListView.addAction(
context_menu_action( context_menu_action(
self.ListView, u':/general/general_add.png', self.ListView, u':/general/general_add.png',
translate(u'MediaManagerItem', translate('MediaManagerItem',
u'&Add to selected Service Item'), '&Add to selected Service Item'),
self.onAddEditClick)) self.onAddEditClick))
QtCore.QObject.connect( QtCore.QObject.connect(
self.ListView, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.ListView, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
@ -352,7 +352,7 @@ class MediaManagerItem(QtGui.QWidget):
""" """
if not self.ListView.selectedIndexes(): if not self.ListView.selectedIndexes():
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate(u'MediaManagerItem', u'No Items Selected'), message) translate('MediaManagerItem', 'No Items Selected'), message)
return False return False
return True return True
@ -422,9 +422,9 @@ class MediaManagerItem(QtGui.QWidget):
def onPreviewClick(self): def onPreviewClick(self):
if not self.ListView.selectedIndexes() and not self.remoteTriggered: if not self.ListView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate(u'MediaManagerItem', u'No Items Selected'), translate('MediaManagerItem', 'No Items Selected'),
translate(u'MediaManagerItem', translate('MediaManagerItem',
u'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.PluginNameShort + u' Preview requested')
service_item = self.buildServiceItem() service_item = self.buildServiceItem()
@ -435,9 +435,9 @@ class MediaManagerItem(QtGui.QWidget):
def onLiveClick(self): def onLiveClick(self):
if not self.ListView.selectedIndexes(): if not self.ListView.selectedIndexes():
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate(u'MediaManagerItem', u'No Items Selected'), translate('MediaManagerItem', 'No Items Selected'),
translate(u'MediaManagerItem', translate('MediaManagerItem',
u'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.PluginNameShort + u' Live requested')
service_item = self.buildServiceItem() service_item = self.buildServiceItem()
@ -448,9 +448,9 @@ class MediaManagerItem(QtGui.QWidget):
def onAddClick(self): def onAddClick(self):
if not self.ListView.selectedIndexes() and not self.remoteTriggered: if not self.ListView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate(u'MediaManagerItem', u'No Items Selected'), translate('MediaManagerItem', 'No Items Selected'),
translate(u'MediaManagerItem', translate('MediaManagerItem',
u'You must select one or more items.')) 'You must select one or more items.'))
else: else:
#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?
@ -472,17 +472,17 @@ class MediaManagerItem(QtGui.QWidget):
def onAddEditClick(self): def onAddEditClick(self):
if not self.ListView.selectedIndexes() and not self.remoteTriggered: if not self.ListView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate(u'MediaManagerItem', u'No items selected'), translate('MediaManagerItem', 'No items selected'),
translate(u'MediaManagerItem', translate('MediaManagerItem',
u'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.PluginNameShort + u' Add requested')
service_item = self.parent.service_manager.getServiceItem() service_item = self.parent.service_manager.getServiceItem()
if not service_item: if not service_item:
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate(u'MediaManagerItem', u'No Service Item Selected'), translate('MediaManagerItem', 'No Service Item Selected'),
translate(u'MediaManagerItem', translate('MediaManagerItem',
u'You must select an existing service item to add to.')) 'You must select an existing service item to add to.'))
elif self.title.lower() == service_item.name.lower(): elif self.title.lower() == service_item.name.lower():
self.generateSlideData(service_item) self.generateSlideData(service_item)
self.parent.service_manager.addServiceItem(service_item, self.parent.service_manager.addServiceItem(service_item,
@ -490,9 +490,9 @@ class MediaManagerItem(QtGui.QWidget):
else: else:
#Turn off the remote edit update message indicator #Turn off the remote edit update message indicator
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate(u'MediaManagerItem', u'Invalid Service Item'), translate('MediaManagerItem', 'Invalid Service Item'),
translate(unicode(u'MediaManagerItem', translate(unicode('MediaManagerItem',
u'You must select a %s service item.')) % self.title) 'You must select a %s service item.')) % self.title)
def buildServiceItem(self, item=None): def buildServiceItem(self, item=None):
""" """

View File

@ -100,14 +100,14 @@ class Ui_PluginViewDialog(object):
def retranslateUi(self, PluginViewDialog): def retranslateUi(self, PluginViewDialog):
PluginViewDialog.setWindowTitle( PluginViewDialog.setWindowTitle(
translate(u'PluginForm', u'Plugin List')) translate('PluginForm', 'Plugin List'))
self.PluginInfoGroupBox.setTitle( self.PluginInfoGroupBox.setTitle(
translate(u'PluginForm', u'Plugin Details')) translate('PluginForm', 'Plugin Details'))
self.VersionLabel.setText( self.VersionLabel.setText(
translate(u'PluginForm', u'Version:')) translate('PluginForm', 'Version:'))
self.VersionNumberLabel.setText(translate(u'PluginForm', u'TextLabel')) self.VersionNumberLabel.setText(translate('PluginForm', 'TextLabel'))
self.AboutLabel.setText(translate(u'PluginForm', u'About:')) self.AboutLabel.setText(translate('PluginForm', 'About:'))
self.StatusLabel.setText(translate(u'PluginForm', u'Status:')) self.StatusLabel.setText(translate('PluginForm', 'Status:'))
self.StatusComboBox.setItemText(0, translate(u'PluginForm', u'Active')) self.StatusComboBox.setItemText(0, translate('PluginForm', 'Active'))
self.StatusComboBox.setItemText(1, self.StatusComboBox.setItemText(1,
translate(u'PluginForm', u'Inactive')) translate('PluginForm', 'Inactive'))

View File

@ -63,15 +63,15 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
# sometimes when it's loaded from the config, it isn't cast to int. # sometimes when it's loaded from the config, it isn't cast to int.
plugin.status = int(plugin.status) plugin.status = int(plugin.status)
# Set the little status text in brackets next to the plugin name. # Set the little status text in brackets next to the plugin name.
status_text = unicode(translate(u'PluginForm', u'%s (Inactive)')) status_text = unicode(translate('PluginForm', '%s (Inactive)'))
if plugin.status == PluginStatus.Active: if plugin.status == PluginStatus.Active:
status_text = unicode(translate(u'PluginForm', u'%s (Active)')) status_text = unicode(translate('PluginForm', '%s (Active)'))
elif plugin.status == PluginStatus.Inactive: elif plugin.status == PluginStatus.Inactive:
status_text = unicode( status_text = unicode(
translate(u'PluginForm', u'%s (Inactive)')) translate('PluginForm', '%s (Inactive)'))
elif plugin.status == PluginStatus.Disabled: elif plugin.status == PluginStatus.Disabled:
status_text = unicode( status_text = unicode(
translate(u'PluginForm', u'%s (Disabled)')) translate('PluginForm', '%s (Disabled)'))
item.setText(status_text % plugin.name) item.setText(status_text % plugin.name)
# If the plugin has an icon, set it! # If the plugin has an icon, set it!
if plugin.icon: if plugin.icon:

View File

@ -68,9 +68,9 @@ class Ui_ServiceItemEditDialog(object):
def retranslateUi(self, ServiceItemEditDialog): def retranslateUi(self, ServiceItemEditDialog):
ServiceItemEditDialog.setWindowTitle( ServiceItemEditDialog.setWindowTitle(
translate(u'ServiceItemEditForm', u'Service Item Maintenance')) translate('ServiceItemEditForm', 'Service Item Maintenance'))
self.upButton.setText(translate(u'ServiceItemEditForm', u'Up')) self.upButton.setText(translate('ServiceItemEditForm', 'Up'))
self.deleteButton.setText(translate(u'ServiceItemEditForm', u'Delete')) self.deleteButton.setText(translate('ServiceItemEditForm', 'Delete'))
self.downButton.setText(translate(u'ServiceItemEditForm', u'Down')) self.downButton.setText(translate('ServiceItemEditForm', 'Down'))

View File

@ -116,28 +116,28 @@ class ServiceManager(QtGui.QWidget):
# Create the top toolbar # Create the top toolbar
self.Toolbar = OpenLPToolbar(self) self.Toolbar = OpenLPToolbar(self)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
translate(u'ServiceManager', u'New Service'), translate('ServiceManager', 'New Service'),
u':/general/general_new.png', u':/general/general_new.png',
translate(u'ServiceManager', u'Create a new service'), translate('ServiceManager', 'Create a new service'),
self.onNewService) self.onNewService)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
translate(u'ServiceManager', u'Open Service'), translate('ServiceManager', 'Open Service'),
u':/general/general_open.png', u':/general/general_open.png',
translate(u'ServiceManager', u'Load an existing service'), translate('ServiceManager', 'Load an existing service'),
self.onLoadService) self.onLoadService)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
translate(u'ServiceManager', u'Save Service'), translate('ServiceManager', 'Save Service'),
u':/general/general_save.png', u':/general/general_save.png',
translate(u'ServiceManager', u'Save this service'), translate('ServiceManager', 'Save this service'),
self.onSaveService) self.onSaveService)
self.Toolbar.addSeparator() self.Toolbar.addSeparator()
self.ThemeLabel = QtGui.QLabel(translate(u'ServiceManager', u'Theme:'), self.ThemeLabel = QtGui.QLabel(translate('ServiceManager', 'Theme:'),
self) self)
self.ThemeLabel.setMargin(3) self.ThemeLabel.setMargin(3)
self.Toolbar.addWidget(self.ThemeLabel) self.Toolbar.addWidget(self.ThemeLabel)
self.ThemeComboBox = QtGui.QComboBox(self.Toolbar) self.ThemeComboBox = QtGui.QComboBox(self.Toolbar)
self.ThemeComboBox.setToolTip(translate(u'ServiceManager', self.ThemeComboBox.setToolTip(translate('ServiceManager',
u'Select a theme for the service')) 'Select a theme for the service'))
self.ThemeComboBox.setSizeAdjustPolicy( self.ThemeComboBox.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToContents) QtGui.QComboBox.AdjustToContents)
self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar) self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
@ -169,28 +169,28 @@ class ServiceManager(QtGui.QWidget):
# Add the bottom toolbar # Add the bottom toolbar
self.OrderToolbar = OpenLPToolbar(self) self.OrderToolbar = OpenLPToolbar(self)
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
translate(u'ServiceManager', u'Move to &top'), translate('ServiceManager', 'Move to &top'),
u':/services/service_top.png', u':/services/service_top.png',
translate(u'ServiceManager', u'Move to top'), self.onServiceTop) translate('ServiceManager', 'Move to top'), self.onServiceTop)
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
translate(u'ServiceManager', u'Move &up'), translate('ServiceManager', 'Move &up'),
u':/services/service_up.png', u':/services/service_up.png',
translate(u'ServiceManager', u'Move up order'), self.onServiceUp) translate('ServiceManager', 'Move up order'), self.onServiceUp)
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
translate(u'ServiceManager', u'Move &down'), translate('ServiceManager', 'Move &down'),
u':/services/service_down.png', u':/services/service_down.png',
translate(u'ServiceManager', u'Move down order'), translate('ServiceManager', 'Move down order'),
self.onServiceDown) self.onServiceDown)
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
translate(u'ServiceManager', u'Move to &bottom'), translate('ServiceManager', 'Move to &bottom'),
u':/services/service_bottom.png', u':/services/service_bottom.png',
translate(u'ServiceManager', u'Move to end'), translate('ServiceManager', 'Move to end'),
self.onServiceEnd) self.onServiceEnd)
self.OrderToolbar.addSeparator() self.OrderToolbar.addSeparator()
self.OrderToolbar.addToolbarButton( self.OrderToolbar.addToolbarButton(
translate(u'ServiceManager', u'&Delete From Service'), translate('ServiceManager', '&Delete From Service'),
u':/general/general_delete.png', u':/general/general_delete.png',
translate(u'ServiceManager', u'Delete From Service'), translate('ServiceManager', 'Delete From Service'),
self.onDeleteFromService) self.onDeleteFromService)
self.Layout.addWidget(self.OrderToolbar) self.Layout.addWidget(self.OrderToolbar)
# Connect up our signals and slots # Connect up our signals and slots
@ -222,37 +222,37 @@ class ServiceManager(QtGui.QWidget):
#build the drag and drop context menu #build the drag and drop context menu
self.dndMenu = QtGui.QMenu() self.dndMenu = QtGui.QMenu()
self.newAction = self.dndMenu.addAction( self.newAction = self.dndMenu.addAction(
translate(u'ServiceManager', u'&Add New Item')) translate('ServiceManager', '&Add New Item'))
self.newAction.setIcon(build_icon(u':/general/general_edit.png')) self.newAction.setIcon(build_icon(u':/general/general_edit.png'))
self.addToAction = self.dndMenu.addAction( self.addToAction = self.dndMenu.addAction(
translate(u'ServiceManager', u'&Add to Selected Item')) translate('ServiceManager', '&Add to Selected Item'))
self.addToAction.setIcon(build_icon(u':/general/general_edit.png')) self.addToAction.setIcon(build_icon(u':/general/general_edit.png'))
#build the context menu #build the context menu
self.menu = QtGui.QMenu() self.menu = QtGui.QMenu()
self.editAction = self.menu.addAction( self.editAction = self.menu.addAction(
translate(u'ServiceManager', u'&Edit Item')) translate('ServiceManager', '&Edit Item'))
self.editAction.setIcon(build_icon(u':/general/general_edit.png')) self.editAction.setIcon(build_icon(u':/general/general_edit.png'))
self.maintainAction = self.menu.addAction( self.maintainAction = self.menu.addAction(
translate(u'ServiceManager', u'&Maintain Item')) translate('ServiceManager', '&Maintain Item'))
self.maintainAction.setIcon(build_icon(u':/general/general_edit.png')) self.maintainAction.setIcon(build_icon(u':/general/general_edit.png'))
self.notesAction = self.menu.addAction( self.notesAction = self.menu.addAction(
translate(u'ServiceManager', u'&Notes')) translate('ServiceManager', '&Notes'))
self.notesAction.setIcon(build_icon(u':/services/service_notes.png')) self.notesAction.setIcon(build_icon(u':/services/service_notes.png'))
self.deleteAction = self.menu.addAction( self.deleteAction = self.menu.addAction(
translate(u'ServiceManager', u'&Delete From Service')) translate('ServiceManager', '&Delete From Service'))
self.deleteAction.setIcon(build_icon(u':/general/general_delete.png')) self.deleteAction.setIcon(build_icon(u':/general/general_delete.png'))
self.sep1 = self.menu.addAction(u'') self.sep1 = self.menu.addAction(u'')
self.sep1.setSeparator(True) self.sep1.setSeparator(True)
self.previewAction = self.menu.addAction( self.previewAction = self.menu.addAction(
translate(u'ServiceManager', u'&Preview Verse')) translate('ServiceManager', '&Preview Verse'))
self.previewAction.setIcon(build_icon(u':/general/general_preview.png')) self.previewAction.setIcon(build_icon(u':/general/general_preview.png'))
self.liveAction = self.menu.addAction( self.liveAction = self.menu.addAction(
translate(u'ServiceManager', u'&Live Verse')) translate('ServiceManager', '&Live Verse'))
self.liveAction.setIcon(build_icon(u':/general/general_live.png')) self.liveAction.setIcon(build_icon(u':/general/general_live.png'))
self.sep2 = self.menu.addAction(u'') self.sep2 = self.menu.addAction(u'')
self.sep2.setSeparator(True) self.sep2.setSeparator(True)
self.themeMenu = QtGui.QMenu( self.themeMenu = QtGui.QMenu(
translate(u'ServiceManager', u'&Change Item Theme')) translate('ServiceManager', '&Change Item Theme'))
self.menu.addMenu(self.themeMenu) self.menu.addMenu(self.themeMenu)
def supportedSuffixes(self, suffix): def supportedSuffixes(self, suffix):
@ -484,10 +484,10 @@ class ServiceManager(QtGui.QWidget):
self.parent.generalSettingsSection + u'/save prompt', self.parent.generalSettingsSection + u'/save prompt',
QtCore.QVariant(False)).toBool(): QtCore.QVariant(False)).toBool():
ret = QtGui.QMessageBox.question(self, ret = QtGui.QMessageBox.question(self,
translate(u'ServiceManager', u'Save Changes to Service?'), translate('ServiceManager', 'Save Changes to Service?'),
translate(u'ServiceManager', translate('ServiceManager',
u'Your service is unsaved, do you want to save ' 'Your service is unsaved, do you want to save '
u'those changes before creating a new one?'), 'those changes before creating a new one?'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Cancel | QtGui.QMessageBox.Cancel |
QtGui.QMessageBox.Save), QtGui.QMessageBox.Save),
@ -570,9 +570,9 @@ class ServiceManager(QtGui.QWidget):
log.debug(u'onSaveService') log.debug(u'onSaveService')
if not quick or self.isNew: if not quick or self.isNew:
filename = QtGui.QFileDialog.getSaveFileName(self, filename = QtGui.QFileDialog.getSaveFileName(self,
translate(u'ServiceManager', u'Save Service'), translate('ServiceManager', 'Save Service'),
SettingsManager.get_last_dir(self.parent.serviceSettingsSection), SettingsManager.get_last_dir(self.parent.serviceSettingsSection),
translate(u'ServiceManager', u'OpenLP Service Files (*.osz)')) translate('ServiceManager', 'OpenLP Service Files (*.osz)'))
else: else:
filename = SettingsManager.get_last_dir( filename = SettingsManager.get_last_dir(
self.parent.serviceSettingsSection) self.parent.serviceSettingsSection)
@ -629,7 +629,7 @@ class ServiceManager(QtGui.QWidget):
self.parent.serviceSettingsSection) self.parent.serviceSettingsSection)
else: else:
filename = QtGui.QFileDialog.getOpenFileName( filename = QtGui.QFileDialog.getOpenFileName(
self, translate(u'ServiceManager', u'Open Service'), self, translate('ServiceManager', 'Open Service'),
SettingsManager.get_last_dir( SettingsManager.get_last_dir(
self.parent.serviceSettingsSection), u'Services (*.osz)') self.parent.serviceSettingsSection), u'Services (*.osz)')
self.loadService(filename) self.loadService(filename)
@ -642,10 +642,10 @@ class ServiceManager(QtGui.QWidget):
""" """
if self.parent.serviceNotSaved: if self.parent.serviceNotSaved:
ret = QtGui.QMessageBox.question(self, ret = QtGui.QMessageBox.question(self,
translate(u'ServiceManager', u'Save Changes to Service?'), translate('ServiceManager', 'Save Changes to Service?'),
translate(u'ServiceManager', translate('ServiceManager',
u'Your current service is unsaved, do you want to ' 'Your current service is unsaved, do you want to '
u'save the changes before opening a new one?'), 'save the changes before opening a new one?'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Discard | QtGui.QMessageBox.Discard |
QtGui.QMessageBox.Save), QtGui.QMessageBox.Save),
@ -673,10 +673,10 @@ class ServiceManager(QtGui.QWidget):
ucsfile = file.decode(u'utf-8') ucsfile = file.decode(u'utf-8')
except UnicodeDecodeError: except UnicodeDecodeError:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate(u'ServiceManager', u'Error'), self, translate('ServiceManager', 'Error'),
translate(u'ServiceManager', translate('ServiceManager',
u'File is not a valid service.\n' 'File is not a valid service.\n'
u'The content encoding is not UTF-8.')) 'The content encoding is not UTF-8.'))
log.exception(u'Filename "%s" is not valid UTF-8' % \ log.exception(u'Filename "%s" is not valid UTF-8' % \
file.decode(u'utf-8', u'replace')) file.decode(u'utf-8', u'replace'))
continue continue
@ -708,9 +708,9 @@ class ServiceManager(QtGui.QWidget):
log.exception(u'Failed to remove osd file') log.exception(u'Failed to remove osd file')
else: else:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, translate(u'ServiceManager', u'Error'), self, translate('ServiceManager', 'Error'),
translate(u'ServiceManager', translate('ServiceManager',
u'File is not a valid service.')) 'File is not a valid service.'))
log.exception(u'File contains no service data') log.exception(u'File contains no service data')
except (IOError, NameError): except (IOError, NameError):
log.exception(u'Problem loading a service file') log.exception(u'Problem loading a service file')
@ -825,9 +825,9 @@ class ServiceManager(QtGui.QWidget):
self.serviceItems[item][u'service_item'], count) self.serviceItems[item][u'service_item'], count)
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate(u'ServiceManager', u'Missing Display Handler'), translate('ServiceManager', 'Missing Display Handler'),
translate(u'ServiceManager', u'Your item cannot be displayed ' translate('ServiceManager', 'Your item cannot be displayed '
u'as there is no handler to display it'), 'as there is no handler to display it'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
@ -861,9 +861,9 @@ class ServiceManager(QtGui.QWidget):
self.serviceItems[item][u'service_item'], 0) self.serviceItems[item][u'service_item'], 0)
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate(u'ServiceManager', u'Missing Display Handler'), translate('ServiceManager', 'Missing Display Handler'),
translate(u'ServiceManager', u'Your item cannot be displayed ' translate('ServiceManager', 'Your item cannot be displayed '
u'as there is no handler to display it'), 'as there is no handler to display it'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)

View File

@ -49,4 +49,4 @@ class Ui_ServiceNoteEdit(object):
def retranslateUi(self, ServiceNoteEdit): def retranslateUi(self, ServiceNoteEdit):
ServiceNoteEdit.setWindowTitle( ServiceNoteEdit.setWindowTitle(
translate(u'ServiceNoteForm', u'Service Item Notes')) translate('ServiceNoteForm', 'Service Item Notes'))

View File

@ -128,11 +128,11 @@ class SlideController(QtGui.QWidget):
# Type label for the top of the slide controller # Type label for the top of the slide controller
self.TypeLabel = QtGui.QLabel(self.Panel) self.TypeLabel = QtGui.QLabel(self.Panel)
if self.isLive: if self.isLive:
self.TypeLabel.setText(translate(u'SlideController', u'Live')) self.TypeLabel.setText(translate('SlideController', 'Live'))
self.split = 1 self.split = 1
self.typePrefix = u'live' self.typePrefix = u'live'
else: else:
self.TypeLabel.setText(translate(u'SlideController', u'Preview')) self.TypeLabel.setText(translate('SlideController', 'Preview'))
self.split = 0 self.split = 0
self.typePrefix = u'preview' self.typePrefix = u'preview'
self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;') self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
@ -179,91 +179,91 @@ class SlideController(QtGui.QWidget):
if self.isLive: if self.isLive:
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'First Slide', u':/slides/slide_first.png', u'First Slide', u':/slides/slide_first.png',
translate(u'SlideController', u'Move to first'), translate('SlideController', 'Move to first'),
self.onSlideSelectedFirst) self.onSlideSelectedFirst)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Previous Slide', u':/slides/slide_previous.png', u'Previous Slide', u':/slides/slide_previous.png',
translate(u'SlideController', u'Move to previous'), translate('SlideController', 'Move to previous'),
self.onSlideSelectedPrevious) self.onSlideSelectedPrevious)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Next Slide', u':/slides/slide_next.png', u'Next Slide', u':/slides/slide_next.png',
translate(u'SlideController', u'Move to next'), translate('SlideController', 'Move to next'),
self.onSlideSelectedNext) self.onSlideSelectedNext)
if self.isLive: if self.isLive:
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Last Slide', u':/slides/slide_last.png', u'Last Slide', u':/slides/slide_last.png',
translate(u'SlideController', u'Move to last'), translate('SlideController', 'Move to last'),
self.onSlideSelectedLast) self.onSlideSelectedLast)
if self.isLive: if self.isLive:
self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarSeparator(u'Close Separator')
self.blankButton = self.Toolbar.addToolbarButton( self.blankButton = self.Toolbar.addToolbarButton(
u'Blank Screen', u':/slides/slide_blank.png', u'Blank Screen', u':/slides/slide_blank.png',
translate(u'SlideController', u'Blank Screen'), translate('SlideController', 'Blank Screen'),
self.onBlankDisplay, True) self.onBlankDisplay, True)
self.themeButton = self.Toolbar.addToolbarButton( self.themeButton = self.Toolbar.addToolbarButton(
u'Display Theme', u':/slides/slide_theme.png', u'Display Theme', u':/slides/slide_theme.png',
translate(u'SlideController', u'Theme Screen'), translate('SlideController', 'Theme Screen'),
self.onThemeDisplay, True) self.onThemeDisplay, True)
self.hideButton = self.Toolbar.addToolbarButton( self.hideButton = self.Toolbar.addToolbarButton(
u'Hide screen', u':/slides/slide_desktop.png', u'Hide screen', u':/slides/slide_desktop.png',
translate(u'SlideController', u'Hide Screen'), translate('SlideController', 'Hide Screen'),
self.onHideDisplay, True) self.onHideDisplay, True)
if not self.isLive: if not self.isLive:
self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Go Live', u':/general/general_live.png', u'Go Live', u':/general/general_live.png',
translate(u'SlideController', u'Move to live'), self.onGoLive) translate('SlideController', 'Move to live'), self.onGoLive)
self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Edit Song', u':/general/general_edit.png', u'Edit Song', u':/general/general_edit.png',
translate(u'SlideController', u'Edit and re-preview Song'), translate('SlideController', 'Edit and re-preview Song'),
self.onEditSong) self.onEditSong)
if isLive: if isLive:
self.Toolbar.addToolbarSeparator(u'Loop Separator') self.Toolbar.addToolbarSeparator(u'Loop Separator')
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Start Loop', u':/media/media_time.png', u'Start Loop', u':/media/media_time.png',
translate(u'SlideController', u'Start continuous loop'), translate('SlideController', 'Start continuous loop'),
self.onStartLoop) self.onStartLoop)
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Stop Loop', u':/media/media_stop.png', u'Stop Loop', u':/media/media_stop.png',
translate(u'SlideController', u'Stop continuous loop'), translate('SlideController', 'Stop continuous loop'),
self.onStopLoop) self.onStopLoop)
self.DelaySpinBox = QtGui.QSpinBox() self.DelaySpinBox = QtGui.QSpinBox()
self.DelaySpinBox.setMinimum(1) self.DelaySpinBox.setMinimum(1)
self.DelaySpinBox.setMaximum(180) self.DelaySpinBox.setMaximum(180)
self.Toolbar.addToolbarWidget( self.Toolbar.addToolbarWidget(
u'Image SpinBox', self.DelaySpinBox) u'Image SpinBox', self.DelaySpinBox)
self.DelaySpinBox.setSuffix(translate(u'SlideController', u's')) self.DelaySpinBox.setSuffix(translate('SlideController', 's'))
self.DelaySpinBox.setToolTip( self.DelaySpinBox.setToolTip(
translate(u'SlideController', translate('SlideController',
u'Delay between slides in seconds')) 'Delay between slides in seconds'))
self.ControllerLayout.addWidget(self.Toolbar) self.ControllerLayout.addWidget(self.Toolbar)
#Build a Media ToolBar #Build a Media ToolBar
self.Mediabar = OpenLPToolbar(self) self.Mediabar = OpenLPToolbar(self)
self.Mediabar.addToolbarButton( self.Mediabar.addToolbarButton(
u'Media Start', u':/slides/media_playback_start.png', u'Media Start', u':/slides/media_playback_start.png',
translate(u'SlideController', u'Start playing media'), translate('SlideController', 'Start playing media'),
self.onMediaPlay) self.onMediaPlay)
self.Mediabar.addToolbarButton( self.Mediabar.addToolbarButton(
u'Media Pause', u':/slides/media_playback_pause.png', u'Media Pause', u':/slides/media_playback_pause.png',
translate(u'SlideController', u'Start playing media'), translate('SlideController', 'Start playing media'),
self.onMediaPause) self.onMediaPause)
self.Mediabar.addToolbarButton( self.Mediabar.addToolbarButton(
u'Media Stop', u':/slides/media_playback_stop.png', u'Media Stop', u':/slides/media_playback_stop.png',
translate(u'SlideController', u'Start playing media'), translate('SlideController', 'Start playing media'),
self.onMediaStop) self.onMediaStop)
if self.isLive: if self.isLive:
self.blankButton = self.Mediabar.addToolbarButton( self.blankButton = self.Mediabar.addToolbarButton(
u'Blank Screen', u':/slides/slide_blank.png', u'Blank Screen', u':/slides/slide_blank.png',
translate(u'SlideController', u'Blank Screen'), translate('SlideController', 'Blank Screen'),
self.onBlankDisplay, True) self.onBlankDisplay, True)
self.themeButton = self.Mediabar.addToolbarButton( self.themeButton = self.Mediabar.addToolbarButton(
u'Display Theme', u':/slides/slide_theme.png', u'Display Theme', u':/slides/slide_theme.png',
translate(u'SlideController', u'Theme Screen'), translate('SlideController', 'Theme Screen'),
self.onThemeDisplay, True) self.onThemeDisplay, True)
self.hideButton = self.Mediabar.addToolbarButton( self.hideButton = self.Mediabar.addToolbarButton(
u'Hide screen', u':/slides/slide_desktop.png', u'Hide screen', u':/slides/slide_desktop.png',
translate(u'SlideController', u'Hide Screen'), translate('SlideController', 'Hide Screen'),
self.onHideDisplay, True) self.onHideDisplay, True)
if not self.isLive: if not self.isLive:
self.seekSlider = Phonon.SeekSlider() self.seekSlider = Phonon.SeekSlider()
@ -280,11 +280,11 @@ class SlideController(QtGui.QWidget):
# Build the Song Toolbar # Build the Song Toolbar
if isLive: if isLive:
self.SongMenu = QtGui.QToolButton(self.Toolbar) self.SongMenu = QtGui.QToolButton(self.Toolbar)
self.SongMenu.setText(translate(u'SlideController', u'Go to Verse')) self.SongMenu.setText(translate('SlideController', 'Go to Verse'))
self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup) self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu) self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu)
self.SongMenu.setMenu(QtGui.QMenu( self.SongMenu.setMenu(QtGui.QMenu(
translate(u'SlideController', u'Go to Verse'), self.Toolbar)) translate('SlideController', 'Go to Verse'), self.Toolbar))
self.Toolbar.makeWidgetsInvisible([u'Song Menu']) self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
# Screen preview area # Screen preview area
self.PreviewFrame = QtGui.QFrame(self.Splitter) self.PreviewFrame = QtGui.QFrame(self.Splitter)

View File

@ -64,7 +64,7 @@ class LanguageManager(object):
def language_name(qmFile): def language_name(qmFile):
translator = QtCore.QTranslator() translator = QtCore.QTranslator()
translator.load(qmFile) translator.load(qmFile)
return translator.translate(u'MainWindow', u'English') return translator.translate('MainWindow', 'English')
@staticmethod @staticmethod
def get_language(): def get_language():
@ -90,9 +90,9 @@ class LanguageManager(object):
u'general/language', QtCore.QVariant(language)) u'general/language', QtCore.QVariant(language))
log.info(u'Language file: \'%s\' written to conf file' % language) log.info(u'Language file: \'%s\' written to conf file' % language)
QtGui.QMessageBox.information(None, QtGui.QMessageBox.information(None,
translate(u'LanguageManager', u'Language'), translate('LanguageManager', 'Language'),
translate(u'LanguageManager', translate('LanguageManager',
u'After restart new Language settings will be used.')) 'After restart new Language settings will be used.'))
@staticmethod @staticmethod
def init_qm_list(): def init_qm_list():