forked from openlp/openlp
Fix translation breaking strings
This commit is contained in:
parent
783c2bdf9a
commit
531e50a417
@ -335,37 +335,39 @@ class Plugin(QtCore.QObject):
|
|||||||
"""
|
"""
|
||||||
return self.textStrings[name]
|
return self.textStrings[name]
|
||||||
|
|
||||||
def setPluginTextStrings(self):
|
def setPluginUiTextStrings(self, tooltips):
|
||||||
"""
|
"""
|
||||||
Called to define all translatable texts of the plugin
|
Called to define all translatable texts of the plugin
|
||||||
"""
|
"""
|
||||||
## Load Action ##
|
## Load Action ##
|
||||||
self._setSingularTextString(StringContent.Load,
|
self.__setNameTextString(StringContent.Load,
|
||||||
UiStrings.Load, UiStrings.LoadANew)
|
UiStrings.Load, tooltips[load])
|
||||||
|
## Import Action ##
|
||||||
|
self.__setNameTextString(StringContent.Import,
|
||||||
|
UiStrings.Import, tooltips[import])
|
||||||
## New Action ##
|
## New Action ##
|
||||||
self._setSingularTextString(StringContent.New,
|
self.__setNameTextString(StringContent.New,
|
||||||
UiStrings.Add, UiStrings.AddANew)
|
UiStrings.Add, tooltips[new])
|
||||||
## Edit Action ##
|
## Edit Action ##
|
||||||
self._setSingularTextString(StringContent.Edit,
|
self.__setNameTextString(StringContent.Edit,
|
||||||
UiStrings.Edit, UiStrings.EditSelect)
|
UiStrings.Edit, tooltips[edit])
|
||||||
## Delete Action ##
|
## Delete Action ##
|
||||||
self._setSingularTextString(StringContent.Delete,
|
self.__setNameTextString(StringContent.Delete,
|
||||||
UiStrings.Delete, UiStrings.DeleteSelect)
|
UiStrings.Delete, tooltips[delete])
|
||||||
## Preview Action ##
|
## Preview Action ##
|
||||||
self._setSingularTextString(StringContent.Preview,
|
self.__setNameTextString(StringContent.Preview,
|
||||||
UiStrings.Preview, UiStrings.PreviewSelect)
|
UiStrings.Preview, tooltips[preview])
|
||||||
## Send Live Action ##
|
## Send Live Action ##
|
||||||
self._setSingularTextString(StringContent.Live,
|
self.__setNameTextString(StringContent.Live,
|
||||||
UiStrings.Live, UiStrings.SendSelectLive)
|
UiStrings.Live, tooltips[live])
|
||||||
## Add to Service Action ##
|
## Add to Service Action ##
|
||||||
self._setSingularTextString(StringContent.Service,
|
self.__setNameTextString(StringContent.Service,
|
||||||
UiStrings.Service, UiStrings.AddSelectService)
|
UiStrings.Service, tooltips[service])
|
||||||
|
|
||||||
def _setSingularTextString(self, name, title, tooltip):
|
def __setNameTextString(self, name, title, tooltip):
|
||||||
"""
|
"""
|
||||||
Utility method for creating a plugin's textStrings. This method makes
|
Utility method for creating a plugin's textStrings. This method makes
|
||||||
use of the singular name of the plugin object so must only be called
|
use of the singular name of the plugin object so must only be called
|
||||||
after this has been set.
|
after this has been set.
|
||||||
"""
|
"""
|
||||||
self.textStrings[name] = { u'title': title, u'tooltip': tooltip %
|
self.textStrings[name] = {u'title': title, u'tooltip': tooltip}
|
||||||
self.getString(StringContent.Name)[u'singular']}
|
|
||||||
|
@ -41,40 +41,26 @@ class UiStrings(object):
|
|||||||
# These strings should need a good reason to be retranslated elsewhere.
|
# These strings should need a good reason to be retranslated elsewhere.
|
||||||
# Should some/more/less of these have an & attached?
|
# Should some/more/less of these have an & attached?
|
||||||
Add = translate('OpenLP.Ui', '&Add')
|
Add = translate('OpenLP.Ui', '&Add')
|
||||||
AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.'))
|
|
||||||
AddSelectService = unicode(translate('OpenLP.Ui',
|
|
||||||
'Add the selected %s to the service.'))
|
|
||||||
Advanced = translate('OpenLP.Ui', 'Advanced')
|
Advanced = translate('OpenLP.Ui', 'Advanced')
|
||||||
AllFiles = translate('OpenLP.Ui', 'All Files')
|
AllFiles = translate('OpenLP.Ui', 'All Files')
|
||||||
Authors = translate('OpenLP.Ui', 'Authors')
|
Authors = translate('OpenLP.Ui', 'Authors')
|
||||||
CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.'))
|
CreateService = translate('OpenLP.Ui', 'Create a new service.')
|
||||||
Delete = translate('OpenLP.Ui', '&Delete')
|
Delete = translate('OpenLP.Ui', '&Delete')
|
||||||
DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.'))
|
|
||||||
DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s'))
|
|
||||||
Edit = translate('OpenLP.Ui', '&Edit')
|
Edit = translate('OpenLP.Ui', '&Edit')
|
||||||
EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.'))
|
|
||||||
EditType = unicode(translate('OpenLP.Ui', 'Edit %s'))
|
|
||||||
Error = translate('OpenLP.Ui', 'Error')
|
Error = translate('OpenLP.Ui', 'Error')
|
||||||
ExportType = unicode(translate('OpenLP.Ui', 'Export %s'))
|
|
||||||
Import = translate('OpenLP.Ui', 'Import')
|
Import = translate('OpenLP.Ui', 'Import')
|
||||||
ImportType = unicode(translate('OpenLP.Ui', 'Import %s'))
|
|
||||||
LengthTime = unicode(translate('OpenLP.Ui', 'Length %s'))
|
|
||||||
Live = translate('OpenLP.Ui', 'Live')
|
Live = translate('OpenLP.Ui', 'Live')
|
||||||
Load = translate('OpenLP.Ui', 'Load')
|
Load = translate('OpenLP.Ui', 'Load')
|
||||||
LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.'))
|
|
||||||
New = translate('OpenLP.Ui', 'New')
|
New = translate('OpenLP.Ui', 'New')
|
||||||
NewType = unicode(translate('OpenLP.Ui', 'New %s'))
|
NewService = translate('OpenLP.Ui', 'New Service')
|
||||||
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
|
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
|
||||||
OpenType = unicode(translate('OpenLP.Ui', 'Open %s'))
|
OpenService = translate('OpenLP.Ui', 'Open Service')
|
||||||
Preview = translate('OpenLP.Ui', 'Preview')
|
Preview = translate('OpenLP.Ui', 'Preview')
|
||||||
PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.'))
|
|
||||||
ReplaceBG = translate('OpenLP.Ui', 'Replace Background')
|
ReplaceBG = translate('OpenLP.Ui', 'Replace Background')
|
||||||
ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background')
|
ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background')
|
||||||
ResetBG = translate('OpenLP.Ui', 'Reset Background')
|
ResetBG = translate('OpenLP.Ui', 'Reset Background')
|
||||||
ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background')
|
ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background')
|
||||||
SaveType = unicode(translate('OpenLP.Ui', 'Save %s'))
|
SaveService = translate('OpenLP.Ui', 'Save Service')
|
||||||
SendSelectLive = unicode(translate('OpenLP.Ui',
|
|
||||||
'Send the selected %s live.'))
|
|
||||||
Service = translate('OpenLP.Ui', 'Service')
|
Service = translate('OpenLP.Ui', 'Service')
|
||||||
StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s'))
|
StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s'))
|
||||||
Theme = translate('OpenLP.Ui', 'Theme')
|
Theme = translate('OpenLP.Ui', 'Theme')
|
||||||
|
@ -319,17 +319,16 @@ class Ui_MainWindow(object):
|
|||||||
self.themeManagerDock.setWindowTitle(
|
self.themeManagerDock.setWindowTitle(
|
||||||
translate('OpenLP.MainWindow', 'Theme Manager'))
|
translate('OpenLP.MainWindow', 'Theme Manager'))
|
||||||
self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New'))
|
self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New'))
|
||||||
self.FileNewItem.setToolTip(UiStrings.NewType % UiStrings.Service)
|
self.FileNewItem.setToolTip(UiStrings.NewService)
|
||||||
self.FileNewItem.setStatusTip(
|
self.FileNewItem.setStatusTip(UiStrings.CreateService)
|
||||||
UiStrings.CreateANew % UiStrings.Service.toLower())
|
|
||||||
self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N'))
|
self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N'))
|
||||||
self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open'))
|
self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open'))
|
||||||
self.FileOpenItem.setToolTip(UiStrings.OpenType % UiStrings.Service)
|
self.FileOpenItem.setToolTip(UiStrings.OpenService)
|
||||||
self.FileOpenItem.setStatusTip(
|
self.FileOpenItem.setStatusTip(
|
||||||
translate('OpenLP.MainWindow', 'Open an existing service.'))
|
translate('OpenLP.MainWindow', 'Open an existing service.'))
|
||||||
self.FileOpenItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+O'))
|
self.FileOpenItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+O'))
|
||||||
self.FileSaveItem.setText(translate('OpenLP.MainWindow', '&Save'))
|
self.FileSaveItem.setText(translate('OpenLP.MainWindow', '&Save'))
|
||||||
self.FileSaveItem.setToolTip(UiStrings.SaveType % UiStrings.Service)
|
self.FileSaveItem.setToolTip(UiStrings.SaveService)
|
||||||
self.FileSaveItem.setStatusTip(
|
self.FileSaveItem.setStatusTip(
|
||||||
translate('OpenLP.MainWindow', 'Save the current service to disk.'))
|
translate('OpenLP.MainWindow', 'Save the current service to disk.'))
|
||||||
self.FileSaveItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+S'))
|
self.FileSaveItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+S'))
|
||||||
|
@ -96,18 +96,14 @@ 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(
|
||||||
UiStrings.NewType % UiStrings.Service,
|
UiStrings.NewService, u':/general/general_new.png',
|
||||||
u':/general/general_new.png',
|
UiStrings.Create.Service, self.onNewServiceClicked)
|
||||||
UiStrings.CreateANew % UiStrings.Service.toLower(),
|
|
||||||
self.onNewServiceClicked)
|
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
UiStrings.OpenType % UiStrings.Service,
|
UiStrings.OpenService, u':/general/general_open.png',
|
||||||
u':/general/general_open.png',
|
|
||||||
translate('OpenLP.ServiceManager', 'Load an existing service'),
|
translate('OpenLP.ServiceManager', 'Load an existing service'),
|
||||||
self.onLoadServiceClicked)
|
self.onLoadServiceClicked)
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
UiStrings.SaveType % UiStrings.Service,
|
UiStrings.SaveService, u':/general/general_save.png',
|
||||||
u':/general/general_save.png',
|
|
||||||
translate('OpenLP.ServiceManager', 'Save this service'),
|
translate('OpenLP.ServiceManager', 'Save this service'),
|
||||||
self.saveFile)
|
self.saveFile)
|
||||||
self.toolbar.addSeparator()
|
self.toolbar.addSeparator()
|
||||||
@ -469,7 +465,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
save the file.
|
save the file.
|
||||||
"""
|
"""
|
||||||
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
|
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
|
||||||
UiStrings.SaveType % UiStrings.Service,
|
UiStrings.SaveService,
|
||||||
SettingsManager.get_last_dir(
|
SettingsManager.get_last_dir(
|
||||||
self.mainwindow.serviceSettingsSection),
|
self.mainwindow.serviceSettingsSection),
|
||||||
translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)')))
|
translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)')))
|
||||||
|
@ -63,28 +63,28 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.layout.setObjectName(u'layout')
|
self.layout.setObjectName(u'layout')
|
||||||
self.toolbar = OpenLPToolbar(self)
|
self.toolbar = OpenLPToolbar(self)
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
UiStrings.NewType % UiStrings.Theme,
|
translate('OpenLP.ThemeManager', 'New Theme'),
|
||||||
u':/themes/theme_new.png',
|
u':/themes/theme_new.png',
|
||||||
UiStrings.CreateANew % UiStrings.Theme.toLower(),
|
translate('OpenLP.ThemeManager', 'Create a new theme.'),
|
||||||
self.onAddTheme)
|
self.onAddTheme)
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
UiStrings.EditType % UiStrings.Theme,
|
translate('OpenLP.ThemeManager', 'Edit Theme'),
|
||||||
u':/themes/theme_edit.png',
|
u':/themes/theme_edit.png',
|
||||||
translate('OpenLP.ThemeManager', 'Edit a theme.'),
|
translate('OpenLP.ThemeManager', 'Edit a theme.'),
|
||||||
self.onEditTheme)
|
self.onEditTheme)
|
||||||
self.deleteToolbarAction = self.toolbar.addToolbarButton(
|
self.deleteToolbarAction = self.toolbar.addToolbarButton(
|
||||||
UiStrings.DeleteType % UiStrings.Theme,
|
translate('OpenLP.ThemeManager', 'Delete Theme'),
|
||||||
u':/general/general_delete.png',
|
u':/general/general_delete.png',
|
||||||
translate('OpenLP.ThemeManager', 'Delete a theme.'),
|
translate('OpenLP.ThemeManager', 'Delete a theme.'),
|
||||||
self.onDeleteTheme)
|
self.onDeleteTheme)
|
||||||
self.toolbar.addSeparator()
|
self.toolbar.addSeparator()
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
UiStrings.ImportType % UiStrings.Theme,
|
translate('OpenLP.ThemeManager', 'Import Theme'),
|
||||||
u':/general/general_import.png',
|
u':/general/general_import.png',
|
||||||
translate('OpenLP.ThemeManager', 'Import a theme.'),
|
translate('OpenLP.ThemeManager', 'Import a theme.'),
|
||||||
self.onImportTheme)
|
self.onImportTheme)
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
UiStrings.ExportType % UiStrings.Theme,
|
translate('OpenLP.ThemeManager', 'Export Theme'),
|
||||||
u':/general/general_export.png',
|
u':/general/general_export.png',
|
||||||
translate('OpenLP.ThemeManager', 'Export a theme.'),
|
translate('OpenLP.ThemeManager', 'Export a theme.'),
|
||||||
self.onExportTheme)
|
self.onExportTheme)
|
||||||
|
@ -129,9 +129,15 @@ class BiblePlugin(Plugin):
|
|||||||
u'title': translate('BiblesPlugin', 'Bibles', 'container title')
|
u'title': translate('BiblesPlugin', 'Bibles', 'container title')
|
||||||
}
|
}
|
||||||
# Middle Header Bar
|
# Middle Header Bar
|
||||||
## Import Action ##
|
tooltips = {
|
||||||
self.textStrings[StringContent.Import] = {
|
load: u''
|
||||||
u'title': UiStrings.Import,
|
import: translate('BiblesPlugin', 'Import a Bible')
|
||||||
u'tooltip': translate('BiblesPlugin', 'Import a Bible')
|
new: translate('BiblesPlugin', 'Add a new Bible')
|
||||||
|
edit: translate('BiblesPlugin', 'Edit the selected Bible')
|
||||||
|
delete: translate('BiblesPlugin', 'Delete the selected Bible')
|
||||||
|
preview: translate('BiblesPlugin', 'Preview the selected Bible')
|
||||||
|
live: translate('BiblesPlugin', 'Send the selected Bible live')
|
||||||
|
service: translate('BiblesPlugin',
|
||||||
|
'Add the selected Bible to the service')
|
||||||
}
|
}
|
||||||
Plugin.setPluginTextStrings(self)
|
self.setPluginUiTextStrings(tooltips)
|
||||||
|
@ -106,13 +106,18 @@ class CustomPlugin(Plugin):
|
|||||||
u'title': translate('CustomsPlugin', 'Custom', 'container title')
|
u'title': translate('CustomsPlugin', 'Custom', 'container title')
|
||||||
}
|
}
|
||||||
# Middle Header Bar
|
# Middle Header Bar
|
||||||
## Import Action ##
|
tooltips = {
|
||||||
self.textStrings[StringContent.Import] = {
|
load: translate('CustomsPlugin', 'Load a new Custom')
|
||||||
u'title': UiStrings.Import,
|
import: translate('CustomsPlugin', 'Import a Custom')
|
||||||
u'tooltip': translate('CustomsPlugin',
|
new: translate('CustomsPlugin', 'Add a new Custom')
|
||||||
'Import a Custom')
|
edit: translate('CustomsPlugin', 'Edit the selected Custom')
|
||||||
|
delete: translate('CustomsPlugin', 'Delete the selected Custom')
|
||||||
|
preview: translate('CustomsPlugin', 'Preview the selected Custom')
|
||||||
|
live: translate('CustomsPlugin', 'Send the selected Custom live')
|
||||||
|
service: translate('CustomsPlugin',
|
||||||
|
'Add the selected Custom to the service')
|
||||||
}
|
}
|
||||||
Plugin.setPluginTextStrings(self)
|
self.setPluginUiTextStrings(tooltips)
|
||||||
|
|
||||||
def finalise(self):
|
def finalise(self):
|
||||||
"""
|
"""
|
||||||
|
@ -69,4 +69,15 @@ class ImagePlugin(Plugin):
|
|||||||
u'title': translate('ImagePlugin', 'Images', 'container title')
|
u'title': translate('ImagePlugin', 'Images', 'container title')
|
||||||
}
|
}
|
||||||
# Middle Header Bar
|
# Middle Header Bar
|
||||||
Plugin.setPluginTextStrings(self)
|
tooltips = {
|
||||||
|
load: translate('ImagePlugin', 'Load a new Image')
|
||||||
|
import: u''
|
||||||
|
new: translate('ImagePlugin', 'Add a new Image')
|
||||||
|
edit: translate('ImagePlugin', 'Edit the selected Image')
|
||||||
|
delete: translate('ImagePlugin', 'Delete the selected Image')
|
||||||
|
preview: translate('ImagePlugin', 'Preview the selected Image')
|
||||||
|
live: translate('ImagePlugin', 'Send the selected Image live')
|
||||||
|
service: translate('ImagePlugin',
|
||||||
|
'Add the selected Image to the service')
|
||||||
|
}
|
||||||
|
self.setPluginUiTextStrings(tooltips)
|
||||||
|
@ -95,4 +95,15 @@ class MediaPlugin(Plugin):
|
|||||||
u'title': translate('MediaPlugin', 'Media', 'container title')
|
u'title': translate('MediaPlugin', 'Media', 'container title')
|
||||||
}
|
}
|
||||||
# Middle Header Bar
|
# Middle Header Bar
|
||||||
Plugin.setPluginTextStrings(self)
|
tooltips = {
|
||||||
|
load: translate('MediaPlugin', 'Load a new Media')
|
||||||
|
import: u''
|
||||||
|
new: translate('MediaPlugin', 'Add a new Media')
|
||||||
|
edit: translate('MediaPlugin', 'Edit the selected Media')
|
||||||
|
delete: translate('MediaPlugin', 'Delete the selected Media')
|
||||||
|
preview: translate('MediaPlugin', 'Preview the selected Media')
|
||||||
|
live: translate('MediaPlugin', 'Send the selected Media live')
|
||||||
|
service: translate('MediaPlugin',
|
||||||
|
'Add the selected Media to the service')
|
||||||
|
}
|
||||||
|
self.setPluginUiTextStrings(tooltips)
|
||||||
|
@ -167,4 +167,18 @@ class PresentationPlugin(Plugin):
|
|||||||
'container title')
|
'container title')
|
||||||
}
|
}
|
||||||
# Middle Header Bar
|
# Middle Header Bar
|
||||||
Plugin.setPluginTextStrings(self)
|
tooltips = {
|
||||||
|
load: translate('PresentationPlugin', 'Load a new Presentation')
|
||||||
|
import: u''
|
||||||
|
new: u''
|
||||||
|
edit: u''
|
||||||
|
delete: translate('PresentationPlugin',
|
||||||
|
'Delete the selected Presentation')
|
||||||
|
preview: translate('PresentationPlugin',
|
||||||
|
'Preview the selected Presentation')
|
||||||
|
live: translate('PresentationPlugin',
|
||||||
|
'Send the selected Presentation live')
|
||||||
|
service: translate('PresentationPlugin',
|
||||||
|
'Add the selected Presentation to the service')
|
||||||
|
}
|
||||||
|
self.setPluginUiTextStrings(tooltips)
|
||||||
|
@ -228,7 +228,18 @@ class SongsPlugin(Plugin):
|
|||||||
u'title': translate('SongsPlugin', 'Songs', 'container title')
|
u'title': translate('SongsPlugin', 'Songs', 'container title')
|
||||||
}
|
}
|
||||||
# Middle Header Bar
|
# Middle Header Bar
|
||||||
Plugin.setPluginTextStrings(self)
|
tooltips = {
|
||||||
|
load: u''
|
||||||
|
import: u''
|
||||||
|
new: translate('SongsPlugin', 'Add a new Song')
|
||||||
|
edit: translate('SongsPlugin', 'Edit the selected Song')
|
||||||
|
delete: translate('SongsPlugin', 'Delete the selected Song')
|
||||||
|
preview: translate('SongsPlugin', 'Preview the selected Song')
|
||||||
|
live: translate('SongsPlugin', 'Send the selected Song live')
|
||||||
|
service: translate('SongsPlugin',
|
||||||
|
'Add the selected Song to the service')
|
||||||
|
}
|
||||||
|
self.setPluginUiTextStrings(tooltips)
|
||||||
|
|
||||||
def finalise(self):
|
def finalise(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user