From 027391d3217ec5d77034e8387eb112bf213fa0b1 Mon Sep 17 00:00:00 2001 From: Chris Witterholt Date: Tue, 16 Apr 2024 18:16:24 +0000 Subject: [PATCH] Fix missing verse translations --- openlp/core/common/i18n.py | 18 +++++++++++ openlp/plugins/songs/forms/editversedialog.py | 32 ++++++++++++------- openlp/plugins/songs/lib/__init__.py | 13 ++------ 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/openlp/core/common/i18n.py b/openlp/core/common/i18n.py index 940b45049..c7c3b8d55 100644 --- a/openlp/core/common/i18n.py +++ b/openlp/core/common/i18n.py @@ -356,10 +356,12 @@ class UiStrings(metaclass=Singleton): self.BibleNoBibles = translate('OpenLP.Ui', 'There are no Bibles currently installed.

' 'Please use the Import Wizard to install one or more Bibles.') self.Bottom = translate('OpenLP.Ui', 'Bottom') + self.Bridge = translate('SongsPlugin.VerseType', 'Bridge') self.Browse = translate('OpenLP.Ui', 'Browse...') self.Cancel = translate('OpenLP.Ui', 'Cancel') self.CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:') self.CCLISongNumberLabel = translate('OpenLP.Ui', 'CCLI song number:') + self.Chorus = translate('SongsPlugin.VerseType', 'Chorus') self.CreateService = translate('OpenLP.Ui', 'Create a new service.') self.ConfirmDelete = translate('OpenLP.Ui', 'Confirm Delete') self.Continuous = translate('OpenLP.Ui', 'Continuous') @@ -371,14 +373,20 @@ class UiStrings(metaclass=Singleton): '.html#strftime-strptime-behavior for more information.') self.Delete = translate('OpenLP.Ui', '&Delete') self.DisplayStyle = translate('OpenLP.Ui', 'Display style:') + self.Down = translate('SongsPlugin.EditVerseForm', 'Down') self.Duplicate = translate('OpenLP.Ui', 'Duplicate Error') self.Edit = translate('OpenLP.Ui', '&Edit') + self.EditVerse = translate('SongsPlugin.EditVerseForm', 'Edit Verse') self.EmptyField = translate('OpenLP.Ui', 'Empty Field') + self.Ending = translate('SongsPlugin.VerseType', 'Ending') self.Error = translate('OpenLP.Ui', 'Error') self.Export = translate('OpenLP.Ui', 'Export') self.File = translate('OpenLP.Ui', 'File') self.FileCorrupt = translate('OpenLP.Ui', 'File appears to be corrupt.') self.FontSizePtUnit = translate('OpenLP.Ui', 'pt', 'Abbreviated font point size unit') + self.ForcedSplit = translate('SongsPlugin.EditVerseForm', '&Forced Split') + self.ForcedSplitToolTip = translate('SongsPlugin.EditVerseForm', 'Split the verse when displayed ' + 'regardless of the screen size.') self.Help = translate('OpenLP.Ui', 'Help') self.Hours = translate('OpenLP.Ui', 'h', 'The abbreviated unit for hours') self.IFdSs = translate('OpenLP.Ui', 'Invalid Folder Selected', 'Singular') @@ -386,6 +394,10 @@ class UiStrings(metaclass=Singleton): self.IFSp = translate('OpenLP.Ui', 'Invalid Files Selected', 'Plural') self.Image = translate('OpenLP.Ui', 'Image') self.Import = translate('OpenLP.Ui', 'Import') + self.Insert = translate('SongsPlugin.EditVerseForm', '&Insert') + self.InsertToolTip = translate('SongsPlugin.EditVerseForm', + 'Split a slide into two by inserting a verse splitter.') + self.Intro = translate('SongsPlugin.VerseType', 'Intro') self.LayoutStyle = translate('OpenLP.Ui', 'Layout style:') self.Live = translate('OpenLP.Ui', 'Live') self.LiveStream = translate('OpenLP.Ui', 'Live Stream') @@ -414,8 +426,10 @@ class UiStrings(metaclass=Singleton): self.OpenService = translate('OpenLP.Ui', 'Open service.') self.OptionalShowInFooter = translate('OpenLP.Ui', 'Optional, this will be displayed in footer.') self.OptionalHideInFooter = translate('OpenLP.Ui', 'Optional, this won\'t be displayed in footer.') + self.Other = translate('SongsPlugin.VerseType', 'Other') self.PlaySlidesInLoop = translate('OpenLP.Ui', 'Play Slides in Loop') self.PlaySlidesToEnd = translate('OpenLP.Ui', 'Play Slides to End') + self.PreChorus = translate('SongsPlugin.VerseType', 'Pre-Chorus') self.Preview = translate('OpenLP.Ui', 'Preview') self.PreviewToolbar = translate('OpenLP.Ui', 'Preview Toolbar') self.PrintService = translate('OpenLP.Ui', 'Print Service') @@ -449,9 +463,13 @@ class UiStrings(metaclass=Singleton): self.Themes = translate('OpenLP.Ui', 'Themes', 'Plural') self.Tools = translate('OpenLP.Ui', 'Tools') self.Top = translate('OpenLP.Ui', 'Top') + self.Transpose = translate('SongsPlugin.EditVerseForm', 'Transpose:') self.UnsupportedFile = translate('OpenLP.Ui', 'Unsupported File') + self.Up = translate('SongsPlugin.EditVerseForm', 'Up') + self.Verse = translate('SongsPlugin.VerseType', 'Verse') self.VersePerSlide = translate('OpenLP.Ui', 'Verse Per Slide') self.VersePerLine = translate('OpenLP.Ui', 'Verse Per Line') + self.VerseType = translate('SongsPlugin.EditVerseForm', '&Verse type:') self.Version = translate('OpenLP.Ui', 'Version') self.View = translate('OpenLP.Ui', 'View') self.ViewMode = translate('OpenLP.Ui', 'View Mode') diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 8e61c9f3a..780f25638 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -21,7 +21,7 @@ from PyQt5 import QtWidgets -from openlp.core.common.i18n import UiStrings, translate +from openlp.core.common.i18n import UiStrings from openlp.core.lib.ui import create_button_box from openlp.core.ui.icons import UiIcons from openlp.core.widgets.edits import SpellTextEdit @@ -87,8 +87,18 @@ class Ui_EditVerseDialog(object): self.retranslate_ui(edit_verse_dialog) def retranslate_ui(self, edit_verse_dialog): - edit_verse_dialog.setWindowTitle(translate('SongsPlugin.EditVerseForm', 'Edit Verse')) - self.verse_type_label.setText(translate('SongsPlugin.EditVerseForm', '&Verse type:')) + VerseType.translated_names = [ + UiStrings().Verse, + UiStrings().Chorus, + UiStrings().Bridge, + UiStrings().PreChorus, + UiStrings().Intro, + UiStrings().Ending, + UiStrings().Other + ] + VerseType.translated_tags = [name[0].lower() for name in VerseType.translated_names] + edit_verse_dialog.setWindowTitle(UiStrings().EditVerse) + self.verse_type_label.setText(UiStrings().VerseType) self.verse_type_combo_box.setItemText(VerseType.Verse, VerseType.translated_names[VerseType.Verse]) self.verse_type_combo_box.setItemText(VerseType.Chorus, VerseType.translated_names[VerseType.Chorus]) self.verse_type_combo_box.setItemText(VerseType.Bridge, VerseType.translated_names[VerseType.Bridge]) @@ -98,12 +108,10 @@ class Ui_EditVerseDialog(object): self.verse_type_combo_box.setItemText(VerseType.Other, VerseType.translated_names[VerseType.Other]) self.overflow_split_button.setText(UiStrings().Split) self.overflow_split_button.setToolTip(UiStrings().SplitToolTip) - self.forced_split_button.setText(translate('SongsPlugin.EditVerseForm', '&Forced Split')) - self.forced_split_button.setToolTip(translate('SongsPlugin.EditVerseForm', 'Split the verse when displayed ' - 'regardless of the screen size.')) - self.insert_button.setText(translate('SongsPlugin.EditVerseForm', '&Insert')) - self.insert_button.setToolTip(translate('SongsPlugin.EditVerseForm', - 'Split a slide into two by inserting a verse splitter.')) - self.transpose_label.setText(translate('SongsPlugin.EditVerseForm', 'Transpose:')) - self.transpose_up_button.setText(translate('SongsPlugin.EditVerseForm', 'Up')) - self.transpose_down_button.setText(translate('SongsPlugin.EditVerseForm', 'Down')) + self.forced_split_button.setText(UiStrings().ForcedSplit) + self.forced_split_button.setToolTip(UiStrings().ForcedSplitToolTip) + self.insert_button.setText(UiStrings().Insert) + self.insert_button.setToolTip(UiStrings().InsertToolTip) + self.transpose_label.setText(UiStrings().Transpose) + self.transpose_up_button.setText(UiStrings().Up) + self.transpose_down_button.setText(UiStrings().Down) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 854f564cc..1568b62b2 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -144,17 +144,8 @@ class VerseType(object): names = ['Verse', 'Chorus', 'Bridge', 'Pre-Chorus', 'Intro', 'Ending', 'Other'] tags = [name[0].lower() for name in names] - - translated_names = [ - translate('SongsPlugin.VerseType', 'Verse'), - translate('SongsPlugin.VerseType', 'Chorus'), - translate('SongsPlugin.VerseType', 'Bridge'), - translate('SongsPlugin.VerseType', 'Pre-Chorus'), - translate('SongsPlugin.VerseType', 'Intro'), - translate('SongsPlugin.VerseType', 'Ending'), - translate('SongsPlugin.VerseType', 'Other')] - - translated_tags = [name[0].lower() for name in translated_names] + translated_names = names + translated_tags = tags @staticmethod def translated_tag(verse_tag, default=Other):