Fixed syntax in translate() function that contained u'%s' and % stuff

This commit is contained in:
Frode Woldsund 2010-06-17 00:11:11 +02:00
parent e94bba463b
commit 40fbf5ad63

View File

@ -208,43 +208,49 @@ class MediaManagerItem(QtGui.QWidget):
## Import Button ## ## Import Button ##
if self.hasImportIcon: if self.hasImportIcon:
self.addToolbarButton( self.addToolbarButton(
u'Import %s' % self.PluginNameShort, unicode(translate(u'MediaManagerItem', u'Import %s')) % \
u'%s %s' % (translate(u'MediaManagerItem', u'Import a'), self.PluginNameShort,
self.PluginNameVisible), unicode(translate(u'MediaManagerItem', u'Import a %s')) % \
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(
u'Load %s' % self.PluginNameShort, unicode(translate(u'MediaManagerItem', u'Load %s')) % \
u'%s %s' % (translate(u'MediaManagerItem', u'Load a new'), self.PluginNameShort,
self.PluginNameVisible), unicode(translate(u'MediaManagerItem', u'Load a new %s')) % \
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(
u'New %s' % self.PluginNameShort, unicode(translate(u'MediaManagerItem', u'New %s')) % \
u'%s %s' % (translate(u'MediaManagerItem', u'Add a new'), self.PluginNameShort,
self.PluginNameVisible), unicode(translate(u'MediaManagerItem', u'Add a new %s')) % \
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(
u'Edit %s' % self.PluginNameShort, unicode(translate(u'MediaManagerItem', u'Edit %s')) % \
u'%s %s' % ( self.PluginNameShort,
translate(u'MediaManagerItem', u'Edit the selected'), unicode(translate(
self.PluginNameVisible), u'MediaManagerItem', u'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(
u'Delete %s' % self.PluginNameShort, unicode(translate(u'MediaManagerItem', u'Delete %s')) % \
self.PluginNameShort,
translate(u'MediaManagerItem', u'Delete the selected item'), translate(u'MediaManagerItem', u'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(
u'Preview %s' % self.PluginNameShort, unicode(translate(u'MediaManagerItem', u'Preview %s')) % \
self.PluginNameShort,
translate(u'MediaManagerItem', u'Preview the selected item'), translate(u'MediaManagerItem', u'Preview the selected item'),
u':/general/general_preview.png', self.onPreviewClick) u':/general/general_preview.png', self.onPreviewClick)
## Live Button ## ## Live Button ##
@ -254,7 +260,8 @@ class MediaManagerItem(QtGui.QWidget):
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(
u'Add %s to Service' % self.PluginNameShort, unicode(translate(u'MediaManagerItem', u'Add %s to Service')) % \
self.PluginNameShort,
translate(u'MediaManagerItem', translate(u'MediaManagerItem',
u'Add the selected item(s) to the service'), u'Add the selected item(s) to the service'),
u':/general/general_add.png', self.onAddClick) u':/general/general_add.png', self.onAddClick)
@ -278,23 +285,23 @@ class MediaManagerItem(QtGui.QWidget):
self.ListView.addAction( self.ListView.addAction(
contextMenuAction( contextMenuAction(
self.ListView, u':/general/general_edit.png', self.ListView, u':/general/general_edit.png',
u'%s %s' % (translate(u'MediaManagerItem', u'&Edit'), unicode(translate(u'MediaManagerItem', u'&Edit %s')) % \
self.PluginNameVisible), self.PluginNameVisible,
self.onEditClick)) self.onEditClick))
self.ListView.addAction(contextMenuSeparator(self.ListView)) self.ListView.addAction(contextMenuSeparator(self.ListView))
if self.hasDeleteIcon: if self.hasDeleteIcon:
self.ListView.addAction( self.ListView.addAction(
contextMenuAction( contextMenuAction(
self.ListView, u':/general/general_delete.png', self.ListView, u':/general/general_delete.png',
u'%s %s' % (translate(u'MediaManagerItem', u'&Delete'), unicode(translate(u'MediaManagerItem', u'&Delete %s')) % \
self.PluginNameVisible), self.PluginNameVisible,
self.onDeleteClick)) self.onDeleteClick))
self.ListView.addAction(contextMenuSeparator(self.ListView)) self.ListView.addAction(contextMenuSeparator(self.ListView))
self.ListView.addAction( self.ListView.addAction(
contextMenuAction( contextMenuAction(
self.ListView, u':/general/general_preview.png', self.ListView, u':/general/general_preview.png',
u'%s %s' % (translate(u'MediaManagerItem', u'&Preview'), unicode(translate(u'MediaManagerItem', u'&Preview %s')) % \
self.PluginNameVisible), self.PluginNameVisible,
self.onPreviewClick)) self.onPreviewClick))
self.ListView.addAction( self.ListView.addAction(
contextMenuAction( contextMenuAction(
@ -471,7 +478,7 @@ class MediaManagerItem(QtGui.QWidget):
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate(u'MediaManagerItem', u'Invalid Service Item'), translate(u'MediaManagerItem', u'Invalid Service Item'),
translate(unicode(u'MediaManagerItem', translate(unicode(u'MediaManagerItem',
u'You must select a %s service item.' % self.title))) u'You must select a %s service item.')) % self.title)
def buildServiceItem(self, item=None): def buildServiceItem(self, item=None):
""" """