Dedupe translations

This commit is contained in:
Jon Tibble 2011-02-09 05:04:12 +00:00
parent bd20f83b4b
commit 5607b09f0d
20 changed files with 116 additions and 110 deletions

View File

@ -34,6 +34,29 @@ from openlp.core.lib import build_icon, Receiver, translate
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class UiStrings(object):
"""
Provide standard strings for objects to use.
"""
# These strings should need a good reason to be retranslated elsewhere.
# Should some/more/less of these have an & attached?
Add = translate('OpenLP.Ui', '&Add')
AllFiles = translate('OpenLP.Ui', 'All Files')
Authors = translate('OpenLP.Ui', 'Authors')
Delete = translate('OpenLP.Ui', '&Delete')
Edit = translate('OpenLP.Ui', '&Edit')
Error = translate('OpenLP.Ui', 'Error')
Import = translate('OpenLP.Ui', 'Import')
Live = translate('OpenLP.Ui', 'Live')
Load = translate('OpenLP.Ui', 'Load')
New = translate('OpenLP.Ui', 'New')
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
Preview = translate('OpenLP.Ui', 'Preview')
Service = translate('OpenLP.Ui', 'Service')
Theme = translate('OpenLP.Ui', 'Theme')
Themes = translate('OpenLP.Ui', 'Themes')
def add_welcome_page(parent, image): def add_welcome_page(parent, image):
""" """
Generate an opening welcome page for a wizard using a provided image. Generate an opening welcome page for a wizard using a provided image.
@ -98,13 +121,12 @@ def critical_error_message_box(title=None, message=None, parent=None,
``question`` ``question``
Should this message box question the user. Should this message box question the user.
""" """
error = translate('OpenLP.Ui', 'Error')
if question: if question:
return QtGui.QMessageBox.critical(parent, error, message, return QtGui.QMessageBox.critical(parent, error, message,
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) QtGui.QMessageBox.Yes | QtGui.QMessageBox.No))
data = {u'message': message} data = {u'message': message}
data[u'title'] = title if title else error data[u'title'] = title if title else UiStrings.Error
return Receiver.send_message(u'openlp_error_message', data) return Receiver.send_message(u'openlp_error_message', data)
def media_item_combo_box(parent, name): def media_item_combo_box(parent, name):
@ -134,7 +156,7 @@ def create_delete_push_button(parent, icon=None):
delete_button.setObjectName(u'deleteButton') delete_button.setObjectName(u'deleteButton')
delete_icon = icon if icon else u':/general/general_delete.png' delete_icon = icon if icon else u':/general/general_delete.png'
delete_button.setIcon(build_icon(delete_icon)) delete_button.setIcon(build_icon(delete_icon))
delete_button.setText(translate('OpenLP.Ui', '&Delete')) delete_button.setText(UiStrings.Delete)
delete_button.setToolTip( delete_button.setToolTip(
translate('OpenLP.Ui', 'Delete the selected item.')) translate('OpenLP.Ui', 'Delete the selected item.'))
QtCore.QObject.connect(delete_button, QtCore.QObject.connect(delete_button,

View File

@ -34,7 +34,7 @@ import cPickle
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, translate, DisplayTags from openlp.core.lib import SettingsTab, translate, DisplayTags
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
class DisplayTagTab(SettingsTab): class DisplayTagTab(SettingsTab):
""" """
@ -164,8 +164,7 @@ class DisplayTagTab(SettingsTab):
self.startTagLabel.setText( self.startTagLabel.setText(
translate('OpenLP.DisplayTagTab', 'Start tag')) translate('OpenLP.DisplayTagTab', 'Start tag'))
self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag'))
self.deletePushButton.setText( self.deletePushButton.setText(UiStrings.Delete)
translate('OpenLP.DisplayTagTab', 'Delete'))
self.defaultPushButton.setText( self.defaultPushButton.setText(
translate('OpenLP.DisplayTagTab', 'Default')) translate('OpenLP.DisplayTagTab', 'Default'))
self.newPushButton.setText(translate('OpenLP.DisplayTagTab', 'New')) self.newPushButton.setText(translate('OpenLP.DisplayTagTab', 'New'))

View File

@ -30,7 +30,8 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \ from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \
SettingsManager, PluginManager, Receiver, translate SettingsManager, PluginManager, Receiver, translate
from openlp.core.lib.ui import base_action, checkable_action, icon_action from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \
icon_action
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
ThemeManager, SlideController, PluginForm, MediaDockManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, \
ShortcutListForm ShortcutListForm
@ -295,7 +296,7 @@ class Ui_MainWindow(object):
""" """
Set up the translation system Set up the translation system
""" """
mainWindow.mainTitle = translate('OpenLP.MainWindow', 'OpenLP 2.0') mainWindow.mainTitle = UiStrings.OLPV2
mainWindow.setWindowTitle(mainWindow.mainTitle) mainWindow.setWindowTitle(mainWindow.mainTitle)
self.FileMenu.setTitle(translate('OpenLP.MainWindow', '&File')) self.FileMenu.setTitle(translate('OpenLP.MainWindow', '&File'))
self.FileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import')) self.FileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import'))

View File

@ -32,7 +32,7 @@ from PyQt4.phonon import Phonon
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \ from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
ItemCapabilities, translate ItemCapabilities, translate
from openlp.core.lib.ui import shortcut_action from openlp.core.lib.ui import UiStrings, shortcut_action
from openlp.core.ui import HideMode, MainDisplay from openlp.core.ui import HideMode, MainDisplay
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -87,12 +87,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('OpenLP.SlideController', 'Live')) self.typeLabel.setText(UiStrings.Live)
self.split = 1 self.split = 1
self.typePrefix = u'live' self.typePrefix = u'live'
else: else:
self.typeLabel.setText(translate('OpenLP.SlideController', self.typeLabel.setText(UiStrings.Preview)
'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;')

View File

@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \ from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \
Receiver Receiver
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.utils import get_images_filter from openlp.core.utils import get_images_filter
from themewizard import Ui_ThemeWizard from themewizard import Ui_ThemeWizard
@ -483,8 +483,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
Background Image button pushed. Background Image button pushed.
""" """
images_filter = get_images_filter() images_filter = get_images_filter()
images_filter = '%s;;%s (*.*) (*)' % (images_filter, images_filter = '%s;;%s (*.*) (*)' % (images_filter, UiStrings.AllFiles)
translate('OpenLP.ThemeForm', 'All Files'))
filename = QtGui.QFileDialog.getOpenFileName(self, filename = QtGui.QFileDialog.getOpenFileName(self,
translate('OpenLP.ThemeForm', 'Select Image'), u'', translate('OpenLP.ThemeForm', 'Select Image'), u'',
images_filter) images_filter)

View File

@ -27,6 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate
from openlp.core.lib.ui import UiStrings
class ThemesTab(SettingsTab): class ThemesTab(SettingsTab):
""" """
@ -98,7 +99,7 @@ class ThemesTab(SettingsTab):
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
def retranslateUi(self): def retranslateUi(self):
self.tabTitleVisible = translate('OpenLP.ThemesTab', 'Themes') self.tabTitleVisible = UiStrings.Themes
self.GlobalGroupBox.setTitle( self.GlobalGroupBox.setTitle(
translate('OpenLP.ThemesTab', 'Global Theme')) translate('OpenLP.ThemesTab', 'Global Theme'))
self.LevelGroupBox.setTitle( self.LevelGroupBox.setTitle(

View File

@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, translate from openlp.core.lib import SettingsTab, translate
from openlp.core.lib.ui import create_valign_combo from openlp.core.lib.ui import UiStrings, create_valign_combo
class AlertsTab(SettingsTab): class AlertsTab(SettingsTab):
""" """
@ -117,10 +117,8 @@ class AlertsTab(SettingsTab):
translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
self.TimeoutSpinBox.setSuffix( self.TimeoutSpinBox.setSuffix(
translate('AlertsPlugin.AlertsTab', 's')) translate('AlertsPlugin.AlertsTab', 's'))
self.PreviewGroupBox.setTitle( self.PreviewGroupBox.setTitle(UiStrings.Preview)
translate('AlertsPlugin.AlertsTab', 'Preview')) self.FontPreview.setText(UiStrings.OLPV2)
self.FontPreview.setText(
translate('AlertsPlugin.AlertsTab', 'OpenLP 2.0'))
def onBackgroundColorButtonClicked(self): def onBackgroundColorButtonClicked(self):
new_color = QtGui.QColorDialog.getColor( new_color = QtGui.QColorDialog.getColor(

View File

@ -29,6 +29,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import UiStrings
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -137,38 +138,38 @@ class BiblePlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Import Action ## ## Import Action ##
self.textStrings[StringContent.Import] = { self.textStrings[StringContent.Import] = {
u'title': translate('BiblesPlugin', '&Import'), u'title': UiStrings.Import,
u'tooltip': translate('BiblesPlugin', 'Import a Bible') u'tooltip': translate('BiblesPlugin', 'Import a Bible')
} }
## New Action ## ## New Action ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('BiblesPlugin', '&Add'), u'title': UiStrings.Add,
u'tooltip': translate('BiblesPlugin', 'Add a new Bible') u'tooltip': translate('BiblesPlugin', 'Add a new Bible')
} }
## Edit Action ## ## Edit Action ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('BiblesPlugin', '&Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible') u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('BiblesPlugin', '&Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible') u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('BiblesPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible') u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('BiblesPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('BiblesPlugin', u'tooltip': translate('BiblesPlugin',
'Send the selected Bible live') 'Send the selected Bible live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('BiblesPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('BiblesPlugin', u'tooltip': translate('BiblesPlugin',
'Add the selected Bible to the service') 'Add the selected Bible to the service')
} }

View File

@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.lib import Receiver, SettingsManager, translate
from openlp.core.lib.db import delete_database from openlp.core.lib.db import delete_database
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.ui.wizard import OpenLPWizard from openlp.core.ui.wizard import OpenLPWizard
from openlp.core.utils import AppLocation, string_is_unicode from openlp.core.utils import AppLocation, string_is_unicode
from openlp.plugins.bibles.lib.manager import BibleFormat from openlp.plugins.bibles.lib.manager import BibleFormat
@ -745,8 +745,7 @@ class BibleImportForm(OpenLPWizard):
""" """
if filters: if filters:
filters += u';;' filters += u';;'
filters += u'%s (*)' % translate('BiblesPlugin.ImportWizardForm', filters += u'%s (*)' % UiStrings.AllFiles
'All Files')
filename = QtGui.QFileDialog.getOpenFileName(self, title, filename = QtGui.QFileDialog.getOpenFileName(self, title,
os.path.dirname(SettingsManager.get_last_dir( os.path.dirname(SettingsManager.get_last_dir(
self.plugin.settingsSection, 1)), filters) self.plugin.settingsSection, 1)), filters)

View File

@ -30,6 +30,7 @@ from forms import EditCustomForm
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.db import Manager from openlp.core.lib.db import Manager
from openlp.core.lib.ui import UiStrings
from openlp.plugins.custom.lib import CustomMediaItem, CustomTab from openlp.plugins.custom.lib import CustomMediaItem, CustomTab
from openlp.plugins.custom.lib.db import CustomSlide, init_schema from openlp.plugins.custom.lib.db import CustomSlide, init_schema
@ -114,49 +115,49 @@ class CustomPlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Import Action ## ## Import Action ##
self.textStrings[StringContent.Import] = { self.textStrings[StringContent.Import] = {
u'title': translate('CustomsPlugin', 'Import'), u'title': UiStrings.Import,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Import a Custom') 'Import a Custom')
} }
## Load Action ## ## Load Action ##
self.textStrings[StringContent.Load] = { self.textStrings[StringContent.Load] = {
u'title': translate('CustomsPlugin', 'Load'), u'title': UiStrings.Load,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Load a new Custom') 'Load a new Custom')
} }
## New Action ## ## New Action ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('CustomsPlugin', 'Add'), u'title': UiStrings.Add,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Add a new Custom') 'Add a new Custom')
} }
## Edit Action ## ## Edit Action ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('CustomsPlugin', 'Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Edit the selected Custom') 'Edit the selected Custom')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('CustomsPlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Delete the selected Custom') 'Delete the selected Custom')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('CustomsPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Preview the selected Custom') 'Preview the selected Custom')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('CustomsPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Send the selected Custom live') 'Send the selected Custom live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('CustomsPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Add the selected Custom to the service') 'Add the selected Custom to the service')
} }

View File

@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate from openlp.core.lib import build_icon, translate
from openlp.core.lib.ui import create_save_cancel_button_box, \ from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box, \
create_delete_push_button, create_up_down_push_button_set create_delete_push_button, create_up_down_push_button_set
class Ui_CustomEditDialog(object): class Ui_CustomEditDialog(object):
@ -107,13 +107,11 @@ class Ui_CustomEditDialog(object):
translate('CustomPlugin.EditCustomForm', 'Edit Custom Slides')) translate('CustomPlugin.EditCustomForm', 'Edit Custom Slides'))
self.titleLabel.setText( self.titleLabel.setText(
translate('CustomPlugin.EditCustomForm', '&Title:')) translate('CustomPlugin.EditCustomForm', '&Title:'))
self.addButton.setText( self.addButton.setText(UiStrings.Add)
translate('CustomPlugin.EditCustomForm', '&Add'))
self.addButton.setToolTip( self.addButton.setToolTip(
translate('CustomPlugin.EditCustomForm', 'Add a new slide at ' translate('CustomPlugin.EditCustomForm', 'Add a new slide at '
'bottom.')) 'bottom.'))
self.editButton.setText( self.editButton.setText(UiStrings.Edit)
translate('CustomPlugin.EditCustomForm', '&Edit'))
self.editButton.setToolTip( self.editButton.setToolTip(
translate('CustomPlugin.EditCustomForm', 'Edit the selected ' translate('CustomPlugin.EditCustomForm', 'Edit the selected '
'slide.')) 'slide.'))

View File

@ -27,6 +27,7 @@
import logging import logging
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import UiStrings
from openlp.plugins.images.lib import ImageMediaItem from openlp.plugins.images.lib import ImageMediaItem
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -74,43 +75,43 @@ class ImagePlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Load Button ## ## Load Button ##
self.textStrings[StringContent.Load] = { self.textStrings[StringContent.Load] = {
u'title': translate('ImagePlugin', 'Load'), u'title': UiStrings.Load,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Load a new Image') 'Load a new Image')
} }
## New Button ## ## New Button ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('ImagePlugin', 'Add'), u'title': UiStrings.Add,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Add a new Image') 'Add a new Image')
} }
## Edit Button ## ## Edit Button ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('ImagePlugin', 'Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Edit the selected Image') 'Edit the selected Image')
} }
## Delete Button ## ## Delete Button ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('ImagePlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Delete the selected Image') 'Delete the selected Image')
} }
## Preview ## ## Preview ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('ImagePlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Preview the selected Image') 'Preview the selected Image')
} }
## Live Button ## ## Live Button ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('ImagePlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Send the selected Image live') 'Send the selected Image live')
} }
## Add to service Button ## ## Add to service Button ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('ImagePlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Add the selected Image to the service') 'Add the selected Image to the service')
} }

View File

@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
ItemCapabilities, SettingsManager, translate, check_item_selected, \ ItemCapabilities, SettingsManager, translate, check_item_selected, \
check_directory_exists, Receiver check_directory_exists, Receiver
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.utils import AppLocation, delete_file, get_images_filter from openlp.core.utils import AppLocation, delete_file, get_images_filter
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -64,7 +64,7 @@ class ImageMediaItem(MediaManagerItem):
'Select Image(s)') 'Select Image(s)')
file_formats = get_images_filter() file_formats = get_images_filter()
self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats,
unicode(translate('ImagePlugin.MediaItem', 'All Files'))) unicode(UiStrings.AllFiles))
self.replaceAction.setText( self.replaceAction.setText(
translate('ImagePlugin.MediaItem', 'Replace Background')) translate('ImagePlugin.MediaItem', 'Replace Background'))
self.replaceAction.setToolTip( self.replaceAction.setToolTip(

View File

@ -30,6 +30,7 @@ import mimetypes
from PyQt4.phonon import Phonon from PyQt4.phonon import Phonon
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import UiStrings
from openlp.plugins.media.lib import MediaMediaItem, MediaTab from openlp.plugins.media.lib import MediaMediaItem, MediaTab
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -103,43 +104,43 @@ class MediaPlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Load Action ## ## Load Action ##
self.textStrings[StringContent.Load] = { self.textStrings[StringContent.Load] = {
u'title': translate('MediaPlugin', 'Load'), u'title': UiStrings.Load,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Load a new Media') 'Load a new Media')
} }
## New Action ## ## New Action ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('MediaPlugin', 'Add'), u'title': UiStrings.Add,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Add a new Media') 'Add a new Media')
} }
## Edit Action ## ## Edit Action ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('MediaPlugin', 'Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Edit the selected Media') 'Edit the selected Media')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('MediaPlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Delete the selected Media') 'Delete the selected Media')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('MediaPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Preview the selected Media') 'Preview the selected Media')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('MediaPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Send the selected Media live') 'Send the selected Media live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('MediaPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Add the selected Media to the service') 'Add the selected Media to the service')
} }

View File

@ -31,6 +31,7 @@ import os
import logging import logging
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import UiStrings
from openlp.core.utils import AppLocation from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import PresentationController, \ from openlp.plugins.presentations.lib import PresentationController, \
PresentationMediaItem, PresentationTab PresentationMediaItem, PresentationTab
@ -169,31 +170,31 @@ class PresentationPlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Load Action ## ## Load Action ##
self.textStrings[StringContent.Load] = { self.textStrings[StringContent.Load] = {
u'title': translate('PresentationPlugin', 'Load'), u'title': UiStrings.Load,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Load a new Presentation') 'Load a new Presentation')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('PresentationPlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Delete the selected Presentation') 'Delete the selected Presentation')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('PresentationPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Preview the selected Presentation') 'Preview the selected Presentation')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('PresentationPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Send the selected Presentation live') 'Send the selected Presentation live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('PresentationPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Add the selected Presentation to the service') 'Add the selected Presentation to the service')
} }

View File

@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate from openlp.core.lib import build_icon, translate
from openlp.core.lib.ui import create_save_cancel_button_box from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box
class Ui_EditSongDialog(object): class Ui_EditSongDialog(object):
def setupUi(self, editSongDialog): def setupUi(self, editSongDialog):
@ -257,19 +257,15 @@ class Ui_EditSongDialog(object):
translate('SongsPlugin.EditSongForm', '&Lyrics:')) translate('SongsPlugin.EditSongForm', '&Lyrics:'))
self.verseOrderLabel.setText( self.verseOrderLabel.setText(
translate('SongsPlugin.EditSongForm', '&Verse order:')) translate('SongsPlugin.EditSongForm', '&Verse order:'))
self.verseAddButton.setText( self.verseAddButton.setText(UiStrings.Add)
translate('SongsPlugin.EditSongForm', '&Add')) self.verseEditButton.setText(UiStrings.Edit)
self.verseEditButton.setText(
translate('SongsPlugin.EditSongForm', '&Edit'))
self.verseEditAllButton.setText( self.verseEditAllButton.setText(
translate('SongsPlugin.EditSongForm', 'Ed&it All')) translate('SongsPlugin.EditSongForm', 'Ed&it All'))
self.verseDeleteButton.setText( self.verseDeleteButton.setText(UiStrings.Delete)
translate('SongsPlugin.EditSongForm', '&Delete'))
self.songTabWidget.setTabText( self.songTabWidget.setTabText(
self.songTabWidget.indexOf(self.lyricsTab), self.songTabWidget.indexOf(self.lyricsTab),
translate('SongsPlugin.EditSongForm', 'Title && Lyrics')) translate('SongsPlugin.EditSongForm', 'Title && Lyrics'))
self.authorsGroupBox.setTitle( self.authorsGroupBox.setTitle(UiStrings.Authors)
translate('SongsPlugin.EditSongForm', 'Authors'))
self.authorAddButton.setText( self.authorAddButton.setText(
translate('SongsPlugin.EditSongForm', '&Add to Song')) translate('SongsPlugin.EditSongForm', '&Add to Song'))
self.authorRemoveButton.setText( self.authorRemoveButton.setText(
@ -292,8 +288,7 @@ class Ui_EditSongDialog(object):
self.songTabWidget.indexOf(self.authorsTab), self.songTabWidget.indexOf(self.authorsTab),
translate('SongsPlugin.EditSongForm', translate('SongsPlugin.EditSongForm',
'Authors, Topics && Song Book')) 'Authors, Topics && Song Book'))
self.themeGroupBox.setTitle( self.themeGroupBox.setTitle(UiStrings.Theme)
translate('SongsPlugin.EditSongForm', 'Theme'))
self.themeAddButton.setText( self.themeAddButton.setText(
translate('SongsPlugin.EditSongForm', 'New &Theme')) translate('SongsPlugin.EditSongForm', 'New &Theme'))
self.rightsGroupBox.setTitle( self.rightsGroupBox.setTitle(

View File

@ -32,7 +32,7 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.lib import Receiver, SettingsManager, translate
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.ui.wizard import OpenLPWizard from openlp.core.ui.wizard import OpenLPWizard
from openlp.plugins.songs.lib.importer import SongFormat from openlp.plugins.songs.lib.importer import SongFormat
@ -215,8 +215,7 @@ class SongImportForm(OpenLPWizard):
'Select the import format, and where to import from.')) 'Select the import format, and where to import from.'))
self.formatLabel.setText( self.formatLabel.setText(
translate('SongsPlugin.ImportWizardForm', 'Format:')) translate('SongsPlugin.ImportWizardForm', 'Format:'))
self.formatComboBox.setItemText(0, self.formatComboBox.setItemText(0, UiStrings.OLPV2)
translate('SongsPlugin.ImportWizardForm', 'OpenLP 2.0'))
self.formatComboBox.setItemText(1, self.formatComboBox.setItemText(1,
translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x')) translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x'))
self.formatComboBox.setItemText(2, self.formatComboBox.setItemText(2,
@ -489,8 +488,7 @@ class SongImportForm(OpenLPWizard):
""" """
if filters: if filters:
filters += u';;' filters += u';;'
filters += u'%s (*)' % translate('SongsPlugin.ImportWizardForm', filters += u'%s (*)' % UiStrings.AllFiles
'All Files')
filenames = QtGui.QFileDialog.getOpenFileNames(self, title, filenames = QtGui.QFileDialog.getOpenFileNames(self, title,
SettingsManager.get_last_dir(self.plugin.settingsSection, 1), SettingsManager.get_last_dir(self.plugin.settingsSection, 1),
filters) filters)

View File

@ -27,6 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate from openlp.core.lib import build_icon, translate
from openlp.core.lib.ui import UiStrings
class Ui_SongMaintenanceDialog(object): class Ui_SongMaintenanceDialog(object):
def setupUi(self, songMaintenanceDialog): def setupUi(self, songMaintenanceDialog):
@ -145,30 +146,21 @@ class Ui_SongMaintenanceDialog(object):
def retranslateUi(self, songMaintenanceDialog): def retranslateUi(self, songMaintenanceDialog):
songMaintenanceDialog.setWindowTitle( songMaintenanceDialog.setWindowTitle(
translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance'))
authorsString = translate('SongsPlugin.SongMaintenanceForm', 'Authors') authorsString = UiStrings.Authors
topicsString = translate('SongsPlugin.SongMaintenanceForm', 'Topics') topicsString = translate('SongsPlugin.SongMaintenanceForm', 'Topics')
booksString = translate('SongsPlugin.SongMaintenanceForm', 'Song Books') booksString = translate('SongsPlugin.SongMaintenanceForm', 'Song Books')
self.listItemAuthors.setText(authorsString) self.listItemAuthors.setText(authorsString)
self.listItemTopics.setText(topicsString) self.listItemTopics.setText(topicsString)
self.listItemBooks.setText(booksString) self.listItemBooks.setText(booksString)
self.authorsAddButton.setText( self.authorsAddButton.setText(UiStrings.Add)
translate('SongsPlugin.SongMaintenanceForm', '&Add')) self.authorsEditButton.setText(UiStrings.Edit)
self.authorsEditButton.setText( self.authorsDeleteButton.setText(UiStrings.Delete)
translate('SongsPlugin.SongMaintenanceForm', '&Edit')) self.topicsAddButton.setText(UiStrings.Add)
self.authorsDeleteButton.setText( self.topicsEditButton.setText(UiStrings.Edit)
translate('SongsPlugin.SongMaintenanceForm', '&Delete')) self.topicsDeleteButton.setText(UiStrings.Delete)
self.topicsAddButton.setText( self.booksAddButton.setText(UiStrings.Add)
translate('SongsPlugin.SongMaintenanceForm', '&Add')) self.booksEditButton.setText(UiStrings.Edit)
self.topicsEditButton.setText( self.booksDeleteButton.setText(UiStrings.Delete)
translate('SongsPlugin.SongMaintenanceForm', '&Edit'))
self.topicsDeleteButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Delete'))
self.booksAddButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Add'))
self.booksEditButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Edit'))
self.booksDeleteButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Delete'))
typeListWidth = max(self.fontMetrics().width(authorsString), typeListWidth = max(self.fontMetrics().width(authorsString),
self.fontMetrics().width(topicsString), self.fontMetrics().width(topicsString),
self.fontMetrics().width(booksString)) self.fontMetrics().width(booksString))

View File

@ -33,6 +33,7 @@ from sqlalchemy.sql import or_
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \
ItemCapabilities, translate, check_item_selected, PluginStatus ItemCapabilities, translate, check_item_selected, PluginStatus
from openlp.core.lib.ui import UiStrings
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
SongImportForm SongImportForm
from openlp.plugins.songs.lib import OpenLyrics, SongXML from openlp.plugins.songs.lib import OpenLyrics, SongXML
@ -147,10 +148,8 @@ class SongMediaItem(MediaManagerItem):
translate('SongsPlugin.MediaItem', 'Titles')), translate('SongsPlugin.MediaItem', 'Titles')),
(3, u':/songs/song_search_lyrics.png', (3, u':/songs/song_search_lyrics.png',
translate('SongsPlugin.MediaItem', 'Lyrics')), translate('SongsPlugin.MediaItem', 'Lyrics')),
(4, u':/songs/song_search_author.png', (4, u':/songs/song_search_author.png', UiStrings.Authors),
translate('SongsPlugin.MediaItem', 'Authors')), (5, u':/slides/slide_theme.png', UiStrings.Themes)
(5, u':/slides/slide_theme.png',
translate('SongsPlugin.MediaItem', 'Themes'))
]) ])
self.configUpdated() self.configUpdated()

View File

@ -31,6 +31,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.db import Manager from openlp.core.lib.db import Manager
from openlp.core.lib.ui import UiStrings
from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML
from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.db import init_schema, Song
from openlp.plugins.songs.lib.importer import SongFormat from openlp.plugins.songs.lib.importer import SongFormat
@ -227,37 +228,37 @@ class SongsPlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## New Action ## ## New Action ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('SongsPlugin', 'Add'), u'title': UiStrings.Add,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Add a new Song') 'Add a new Song')
} }
## Edit Action ## ## Edit Action ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('SongsPlugin', 'Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Edit the selected Song') 'Edit the selected Song')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('SongsPlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Delete the selected Song') 'Delete the selected Song')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('SongsPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Preview the selected Song') 'Preview the selected Song')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('SongsPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Send the selected Song live') 'Send the selected Song live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('SongsPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Add the selected Song to the service') 'Add the selected Song to the service')
} }