← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~frodus86/openlp/translate into lp:openlp

 

Frode Woldsund has proposed merging lp:~frodus86/openlp/translate into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


Replaced the last trUtf8() -> translate() 
Fixed the syntax on translate() functions that contained (u'%s') and  (u'...' ,u'..' %)
-- 
https://code.launchpad.net/~frodus86/openlp/translate/+merge/27784
Your team OpenLP Core is requested to review the proposed merge of lp:~frodus86/openlp/translate into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2010-06-15 15:22:26 +0000
+++ openlp/core/lib/mediamanageritem.py	2010-06-16 22:27:25 +0000
@@ -29,7 +29,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import context_menu_action, context_menu_separator, \
-    SettingsManager, OpenLPToolbar, ServiceItem, build_icon
+    SettingsManager, OpenLPToolbar, ServiceItem, build_icon, translate
 
 log = logging.getLogger(__name__)
 
@@ -208,50 +208,62 @@
         ## Import Button ##
         if self.hasImportIcon:
             self.addToolbarButton(
-                u'Import %s' % self.PluginNameShort,
-                u'%s %s' % (self.trUtf8('Import a'), self.PluginNameVisible),
+                unicode(translate(u'MediaManagerItem', u'Import %s')) % \
+                self.PluginNameShort,
+                unicode(translate(u'MediaManagerItem', u'Import a %s')) % \
+                self.PluginNameVisible,
                 u':/general/general_import.png', self.onImportClick)
         ## File Button ##
         if self.hasFileIcon:
             self.addToolbarButton(
-                u'Load %s' % self.PluginNameShort,
-                u'%s %s' % (self.trUtf8('Load a new'), self.PluginNameVisible),
+                unicode(translate(u'MediaManagerItem', u'Load %s')) % \
+                self.PluginNameShort,
+                unicode(translate(u'MediaManagerItem', u'Load a new %s')) % \
+                self.PluginNameVisible,
                 u':/general/general_open.png', self.onFileClick)
         ## New Button ##
         if self.hasNewIcon:
             self.addToolbarButton(
-                u'New %s' % self.PluginNameShort,
-                u'%s %s' % (self.trUtf8('Add a new'), self.PluginNameVisible),
+                unicode(translate(u'MediaManagerItem',  u'New %s')) % \
+                self.PluginNameShort,
+                unicode(translate(u'MediaManagerItem', u'Add a new %s')) % \
+                self.PluginNameVisible,
                 u':/general/general_new.png', self.onNewClick)
         ## Edit Button ##
         if self.hasEditIcon:
             self.addToolbarButton(
-                u'Edit %s' % self.PluginNameShort,
-                u'%s %s' % (self.trUtf8('Edit the selected'),
-                    self.PluginNameVisible),
+                unicode(translate(u'MediaManagerItem',  u'Edit %s')) % \
+                self.PluginNameShort,
+                unicode(translate(
+                    u'MediaManagerItem', u'Edit the selected %s')) % \
+                self.PluginNameVisible,
                 u':/general/general_edit.png', self.onEditClick)
         ## Delete Button ##
         if self.hasDeleteIcon:
             self.addToolbarButton(
-                u'Delete %s' % self.PluginNameShort,
-                self.trUtf8('Delete the selected item'),
+                unicode(translate(u'MediaManagerItem',  u'Delete %s')) % \
+                self.PluginNameShort,
+                translate(u'MediaManagerItem', u'Delete the selected item'),
                 u':/general/general_delete.png', self.onDeleteClick)
         ## Separator Line ##
         self.addToolbarSeparator()
         ## Preview ##
         self.addToolbarButton(
-            u'Preview %s' % self.PluginNameShort,
-            self.trUtf8('Preview the selected item'),
+            unicode(translate(u'MediaManagerItem', u'Preview %s')) % \
+            self.PluginNameShort,
+            translate(u'MediaManagerItem', u'Preview the selected item'),
             u':/general/general_preview.png', self.onPreviewClick)
         ## Live  Button ##
         self.addToolbarButton(
             u'Go Live',
-            self.trUtf8('Send the selected item live'),
+            translate(u'MediaManagerItem', u'Send the selected item live'),
             u':/general/general_live.png', self.onLiveClick)
         ## Add to service Button ##
         self.addToolbarButton(
-            u'Add %s to Service' % self.PluginNameShort,
-            self.trUtf8('Add the selected item(s) to the service'),
+            unicode(translate(u'MediaManagerItem',  u'Add %s to Service')) % \
+            self.PluginNameShort,
+            translate(u'MediaManagerItem', 
+                u'Add the selected item(s) to the service'),
             u':/general/general_add.png', self.onAddClick)
 
     def addListViewToToolBar(self):
@@ -273,34 +285,39 @@
             self.ListView.addAction(
                 context_menu_action(
                     self.ListView, u':/general/general_edit.png',
-                    u'%s %s' % (self.trUtf8('&Edit'), self.PluginNameVisible),
+                    unicode(translate(u'MediaManagerItem', u'&Edit %s')) % \
+                    self.PluginNameVisible,
                     self.onEditClick))
             self.ListView.addAction(context_menu_separator(self.ListView))
         if self.hasDeleteIcon:
             self.ListView.addAction(
                 context_menu_action(
                     self.ListView, u':/general/general_delete.png',
-                    u'%s %s' % (self.trUtf8('&Delete'), self.PluginNameVisible),
+                    unicode(translate(u'MediaManagerItem', u'&Delete %s')) % \
+                    self.PluginNameVisible,
                     self.onDeleteClick))
             self.ListView.addAction(context_menu_separator(self.ListView))
         self.ListView.addAction(
             context_menu_action(
                 self.ListView, u':/general/general_preview.png',
-                u'%s %s' % (self.trUtf8('&Preview'), self.PluginNameVisible),
+                unicode(translate(u'MediaManagerItem', u'&Preview %s')) % \
+                self.PluginNameVisible,
                 self.onPreviewClick))
         self.ListView.addAction(
             context_menu_action(
                 self.ListView, u':/general/general_live.png',
-                self.trUtf8('&Show Live'), self.onLiveClick))
+                translate(u'MediaManagerItem', u'&Show Live'), self.onLiveClick))
         self.ListView.addAction(
             context_menu_action(
                 self.ListView, u':/general/general_add.png',
-                self.trUtf8('&Add to Service'), self.onAddClick))
+                translate(u'MediaManagerItem', u'&Add to Service'), 
+                self.onAddClick))
         if self.addToServiceItem:
             self.ListView.addAction(
                 context_menu_action(
                     self.ListView, u':/general/general_add.png',
-                    self.trUtf8('&Add to selected Service Item'),
+                    translate(u'MediaManagerItem', 
+                        u'&Add to selected Service Item'),
                     self.onAddEditClick))
         QtCore.QObject.connect(
             self.ListView, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
@@ -391,8 +408,9 @@
     def onPreviewClick(self):
         if not self.ListView.selectedIndexes() and not self.remoteTriggered:
             QtGui.QMessageBox.information(self,
-                self.trUtf8('No Items Selected'),
-                self.trUtf8('You must select one or more items.'))
+                translate(u'MediaManagerItem', u'No Items Selected'),
+                translate(u'MediaManagerItem', 
+                    u'You must select one or more items.'))
         else:
             log.debug(self.PluginNameShort + u' Preview requested')
             service_item = self.buildServiceItem()
@@ -403,8 +421,9 @@
     def onLiveClick(self):
         if not self.ListView.selectedIndexes():
             QtGui.QMessageBox.information(self,
-                self.trUtf8('No Items Selected'),
-                self.trUtf8('You must select one or more items.'))
+                translate(u'MediaManagerItem', u'No Items Selected'),
+                translate(u'MediaManagerItem', 
+                    u'You must select one or more items.'))
         else:
             log.debug(self.PluginNameShort + u' Live requested')
             service_item = self.buildServiceItem()
@@ -415,8 +434,9 @@
     def onAddClick(self):
         if not self.ListView.selectedIndexes() and not self.remoteTriggered:
             QtGui.QMessageBox.information(self,
-                self.trUtf8('No Items Selected'),
-                self.trUtf8('You must select one or more items.'))
+                translate(u'MediaManagerItem', u'No Items Selected'),
+                translate(u'MediaManagerItem', 
+                    u'You must select one or more items.'))
         else:
             #Is it posssible to process multiple list items to generate multiple
             #service items?
@@ -438,16 +458,17 @@
     def onAddEditClick(self):
         if not self.ListView.selectedIndexes() and not self.remoteTriggered:
             QtGui.QMessageBox.information(self,
-                self.trUtf8('No items selected'),
-                self.trUtf8('You must select one or more items'))
+                translate(u'MediaManagerItem', u'No items selected'),
+                translate(u'MediaManagerItem', 
+                    u'You must select one or more items'))
         else:
             log.debug(self.PluginNameShort + u' Add requested')
             service_item = self.parent.service_manager.getServiceItem()
             if not service_item:
                 QtGui.QMessageBox.information(self,
-                    self.trUtf8('No Service Item Selected'),
-                    self.trUtf8(
-                        'You must select an existing service item to add to.'))
+                    translate(u'MediaManagerItem', u'No Service Item Selected'),
+                    translate(u'MediaManagerItem', 
+                        u'You must select an existing service item to add to.'))
             elif self.title.lower() == service_item.name.lower():
                 self.generateSlideData(service_item)
                 self.parent.service_manager.addServiceItem(service_item,
@@ -455,9 +476,9 @@
             else:
                 #Turn off the remote edit update message indicator
                 QtGui.QMessageBox.information(self,
-                    self.trUtf8('Invalid Service Item'),
-                    self.trUtf8(unicode(
-                        'You must select a %s service item.' % self.title)))
+                    translate(u'MediaManagerItem', u'Invalid Service Item'),
+                    translate(unicode(u'MediaManagerItem',
+                        u'You must select a %s service item.')) % self.title)
 
     def buildServiceItem(self, item=None):
         """

=== modified file 'openlp/core/ui/splashscreen.py'
--- openlp/core/ui/splashscreen.py	2010-06-06 09:52:11 +0000
+++ openlp/core/ui/splashscreen.py	2010-06-16 22:27:25 +0000
@@ -30,7 +30,8 @@
     def __init__(self, version):
         self.splash_screen = QtGui.QSplashScreen()
         self.setupUi()
-        self.message = self.splash_screen.trUtf8('Starting')\
+        self.message = translate(
+            u'Splashscreen',  u'Starting')\
             + '..... ' + version
 
     def setupUi(self):
@@ -58,7 +59,7 @@
 
     def retranslateUi(self):
         self.splash_screen.setWindowTitle(
-            self.splash_screen.trUtf8('Splash Screen'))
+            translate(u'Splashscreen', u'Splash Screen'))
 
     def show(self):
         self.splash_screen.show()

=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py	2010-06-06 11:49:39 +0000
+++ openlp/plugins/bibles/bibleplugin.py	2010-06-16 22:27:25 +0000
@@ -70,7 +70,8 @@
         self.ImportBibleItem = QtGui.QAction(import_menu)
         self.ImportBibleItem.setObjectName(u'ImportBibleItem')
         import_menu.addAction(self.ImportBibleItem)
-        self.ImportBibleItem.setText(import_menu.trUtf8('&Bible'))
+        self.ImportBibleItem.setText(
+            translate(u'BiblesPlugin.BiblePlugin', u'&Bible'))
         # Signals and slots
         QtCore.QObject.connect(self.ImportBibleItem,
             QtCore.SIGNAL(u'triggered()'), self.onBibleImportClick)
@@ -80,7 +81,8 @@
         self.ExportBibleItem = QtGui.QAction(export_menu)
         self.ExportBibleItem.setObjectName(u'ExportBibleItem')
         export_menu.addAction(self.ExportBibleItem)
-        self.ExportBibleItem.setText(export_menu.trUtf8('&Bible'))
+        self.ExportBibleItem.setText(translate(
+            u'BiblesPlugin.BiblePlugin', u'&Bible'))
         self.ExportBibleItem.setVisible(False)
 
     def onBibleImportClick(self):

=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py	2010-06-08 15:38:09 +0000
+++ openlp/plugins/songs/songsplugin.py	2010-06-16 22:27:25 +0000
@@ -94,36 +94,44 @@
         # Main song import menu item - will eventually be the only one
         self.SongImportItem = QtGui.QAction(import_menu)
         self.SongImportItem.setObjectName(u'SongImportItem')
-        self.SongImportItem.setText(import_menu.trUtf8('&Song'))
+        self.SongImportItem.setText(translate(
+            u'SongsPlugin.SongsPlugin', u'&Song'))
         self.SongImportItem.setToolTip(
-            import_menu.trUtf8('Import songs using the import wizard.'))
+            translate(u'SongsPlugin.SongsPlugin', 
+                u'Import songs using the import wizard.'))
         import_menu.addAction(self.SongImportItem)
         # Songs of Fellowship import menu item - will be removed and the
         # functionality will be contained within the import wizard
         self.ImportSofItem = QtGui.QAction(import_menu)
         self.ImportSofItem.setObjectName(u'ImportSofItem')
         self.ImportSofItem.setText(
-            import_menu.trUtf8('Songs of Fellowship (temp menu item)'))
+            translate(u'SongsPlugin.SongsPlugin', 
+                u'Songs of Fellowship (temp menu item)'))
         self.ImportSofItem.setToolTip(
-            import_menu.trUtf8('Import songs from the VOLS1_2.RTF, sof3words' \
-                + '.rtf and sof4words.rtf supplied with the music books'))
+            translate(u'SongsPlugin.SongsPlugin', 
+                u'Import songs from the VOLS1_2.RTF, sof3words' \
+                + u'.rtf and sof4words.rtf supplied with the music books'))
         self.ImportSofItem.setStatusTip(
-            import_menu.trUtf8('Import songs from the VOLS1_2.RTF, sof3words' \
-                + '.rtf and sof4words.rtf supplied with the music books'))
+            translate(u'SongsPlugin.SongsPlugin', 
+                u'Import songs from the VOLS1_2.RTF, sof3words' \
+                + u'.rtf and sof4words.rtf supplied with the music books'))
         import_menu.addAction(self.ImportSofItem)
         # OpenOffice.org import menu item - will be removed and the
         # functionality will be contained within the import wizard
         self.ImportOooItem = QtGui.QAction(import_menu)
         self.ImportOooItem.setObjectName(u'ImportOooItem')
         self.ImportOooItem.setText(
-            import_menu.trUtf8('Generic Document/Presentation Import '
-                '(temp menu item)'))
+            translate(u'SongsPlugin.SongsPlugin', 
+                u'Generic Document/Presentation Import '
+                u'(temp menu item)'))
         self.ImportOooItem.setToolTip(
-            import_menu.trUtf8('Import songs from '
-                'Word/Writer/Powerpoint/Impress'))
+            translate(u'SongsPlugin.SongsPlugin', 
+                u'Import songs from '
+                u'Word/Writer/Powerpoint/Impress'))
         self.ImportOooItem.setStatusTip(
-            import_menu.trUtf8('Import songs from '
-                'Word/Writer/Powerpoint/Impress'))
+            translate(u'SongsPlugin.SongsPlugin', 
+                u'Import songs from '
+                u'Word/Writer/Powerpoint/Impress'))
         import_menu.addAction(self.ImportOooItem)
         # Signals and slots
         QtCore.QObject.connect(self.SongImportItem,
@@ -161,11 +169,13 @@
         except:
             log.exception('Could not import SoF file')
             QtGui.QMessageBox.critical(None,
-                self.ImportSongMenu.trUtf8('Import Error'),
-                self.ImportSongMenu.trUtf8('Error importing Songs of ' 
-                    'Fellowship file.\nOpenOffice.org must be installed' 
-                    ' and you must be using an unedited copy of the RTF'
-                    ' included with the Songs of Fellowship Music Editions'),
+                translate(u'SongsPlugin.SongsPlugin', 
+                    u'Import Error'),
+                translate(u'SongsPlugin.SongsPlugin', 
+                    u'Error importing Songs of ' 
+                    u'Fellowship file.\nOpenOffice.org must be installed' 
+                    u' and you must be using an unedited copy of the RTF'
+                    u' included with the Songs of Fellowship Music Editions'),
                 QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
                 QtGui.QMessageBox.Ok)
         Receiver.send_message(u'songs_load_list')

=== modified file 'openlp/plugins/songusage/songusageplugin.py'
--- openlp/plugins/songusage/songusageplugin.py	2010-06-06 14:22:00 +0000
+++ openlp/plugins/songusage/songusageplugin.py	2010-06-16 22:27:25 +0000
@@ -59,20 +59,25 @@
         self.toolsMenu = tools_menu
         self.SongUsageMenu = QtGui.QMenu(tools_menu)
         self.SongUsageMenu.setObjectName(u'SongUsageMenu')
-        self.SongUsageMenu.setTitle(tools_menu.trUtf8('&Song Usage'))
+        self.SongUsageMenu.setTitle(translate(
+            u'SongUsagePlugin.SongUsagePlugin', u'&Song Usage'))
         #SongUsage Delete
         self.SongUsageDelete = QtGui.QAction(tools_menu)
         self.SongUsageDelete.setText(
-            tools_menu.trUtf8('&Delete recorded data'))
+            translate(u'SongUsagePlugin.SongUsagePlugin', 
+                u'&Delete recorded data'))
         self.SongUsageDelete.setStatusTip(
-            tools_menu.trUtf8('Delete song usage to specified date'))
+            translate(u'SongUsagePlugin.SongUsagePlugin',
+                u'Delete song usage to specified date'))
         self.SongUsageDelete.setObjectName(u'SongUsageDelete')
         #SongUsage Report
         self.SongUsageReport = QtGui.QAction(tools_menu)
         self.SongUsageReport.setText(
-            tools_menu.trUtf8('&Extract recorded data'))
+            translate(u'SongUsagePlugin.SongUsagePlugin', 
+                u'&Extract recorded data'))
         self.SongUsageReport.setStatusTip(
-            tools_menu.trUtf8('Generate report on Song Usage'))
+            translate(u'SongUsagePlugin.SongUsagePlugin', 
+                u'Generate report on Song Usage'))
         self.SongUsageReport.setObjectName(u'SongUsageReport')
         #SongUsage activation
         SongUsageIcon = build_icon(u':/tools/tools_alert.png')
@@ -80,9 +85,11 @@
         self.SongUsageStatus.setIcon(SongUsageIcon)
         self.SongUsageStatus.setCheckable(True)
         self.SongUsageStatus.setChecked(False)
-        self.SongUsageStatus.setText(tools_menu.trUtf8('Song Usage Status'))
+        self.SongUsageStatus.setText(translate(
+            u'SongUsagePlugin.SongUsagePlugin', u'Song Usage Status'))
         self.SongUsageStatus.setStatusTip(
-            tools_menu.trUtf8('Start/Stop live song usage recording'))
+            translate(u'SongUsagePlugin.SongUsagePlugin', 
+                u'Start/Stop live song usage recording'))
         self.SongUsageStatus.setShortcut(u'F4')
         self.SongUsageStatus.setObjectName(u'SongUsageStatus')
         #Add Menus together


Follow ups