Verse Translations part 1

This commit is contained in:
Tim Bentley 2010-06-05 18:48:26 +01:00
parent 8da2167ebe
commit 9d4cb86a6e
3 changed files with 21 additions and 6 deletions

View File

@ -25,6 +25,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate from openlp.core.lib import translate
from openlp.plugins.songs.lib import TagNames
class Ui_EditVerseDialog(object): class Ui_EditVerseDialog(object):
def setupUi(self, EditVerseDialog): def setupUi(self, EditVerseDialog):
@ -92,8 +93,8 @@ class Ui_EditVerseDialog(object):
def retranslateUi(self, EditVerseDialog): def retranslateUi(self, EditVerseDialog):
EditVerseDialog.setWindowTitle(translate('EditVerseForm', 'Edit Verse')) EditVerseDialog.setWindowTitle(translate('EditVerseForm', 'Edit Verse'))
self.VerseTypeLabel.setText(translate('EditVerseForm', 'Verse Type:')) self.VerseTypeLabel.setText(translate('EditVerseForm', 'Verse Type:'))
self.VerseTypeComboBox.setItemText(0, translate('EditVerseForm', 'Verse')) self.VerseTypeComboBox.setItemText(0, TagNames.verse)
self.VerseTypeComboBox.setItemText(1, translate('EditVerseForm', 'Chorus')) self.VerseTypeComboBox.setItemText(1, TagNames.chorus)
self.VerseTypeComboBox.setItemText(2, translate('EditVerseForm', 'Bridge')) self.VerseTypeComboBox.setItemText(2, translate('EditVerseForm', 'Bridge'))
self.VerseTypeComboBox.setItemText(3, translate('EditVerseForm', 'Pre-Chorus')) self.VerseTypeComboBox.setItemText(3, translate('EditVerseForm', 'Pre-Chorus'))
self.VerseTypeComboBox.setItemText(4, translate('EditVerseForm', 'Intro')) self.VerseTypeComboBox.setItemText(4, translate('EditVerseForm', 'Intro'))

View File

@ -29,6 +29,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from editversedialog import Ui_EditVerseDialog from editversedialog import Ui_EditVerseDialog
from openlp.plugins.songs.lib import TagNames
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -44,9 +45,9 @@ class VerseType(object):
@staticmethod @staticmethod
def to_string(verse_type): def to_string(verse_type):
if verse_type == VerseType.Verse: if verse_type == VerseType.Verse:
return u'Verse' return TagNames.verse
elif verse_type == VerseType.Chorus: elif verse_type == VerseType.Chorus:
return u'Chorus' return TagNames.chorus
elif verse_type == VerseType.Bridge: elif verse_type == VerseType.Bridge:
return u'Bridge' return u'Bridge'
elif verse_type == VerseType.PreChorus: elif verse_type == VerseType.PreChorus:
@ -61,9 +62,9 @@ class VerseType(object):
@staticmethod @staticmethod
def from_string(verse_type): def from_string(verse_type):
verse_type = verse_type.lower() verse_type = verse_type.lower()
if verse_type == u'verse': if verse_type == TagNames.lower_verse:
return VerseType.Verse return VerseType.Verse
elif verse_type == u'chorus': elif verse_type == TagNames.lower_chorus:
return VerseType.Chorus return VerseType.Chorus
elif verse_type == u'bridge': elif verse_type == u'bridge':
return VerseType.Bridge return VerseType.Bridge

View File

@ -23,9 +23,22 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
from openlp.core.lib import translate
class TagNames(object):
verse = translate('TagNames','Verse')
chorus = translate('TagNames','Chorus')
lower_verse = translate('TagNames','verse')
lower_chorus = translate('TagNames','chorus')
from manager import SongManager from manager import SongManager
from songstab import SongsTab from songstab import SongsTab
from mediaitem import SongMediaItem from mediaitem import SongMediaItem
from sofimport import SofImport from sofimport import SofImport
from oooimport import OooImport from oooimport import OooImport
from songimport import SongImport from songimport import SongImport
from openlp.core.lib import translate