Wrong use of translation causes crash in opensong bible import

Bug #1425035 reported by Tomas Groth on 2015-02-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Low
Tomas Groth

Bug Description

Spotted in 2.1.3, on linux and windows while importing this file: http://ubuntu-kr.org/download/file.php?id=14122 (a korean bible in opensong format). See traceback below.

The problem is that the translate call is used in a wrong way:
translate('BiblesPlugin.Opensong', 'Importing %(bookname)s %(chapter)s...' % {'bookname': db_book.name, 'chapter': chapter_number})

It should be:
translate('BiblesPlugin.Opensong', 'Importing %(bookname)s %(chapter)s...') % {'bookname': db_book.name, 'chapter': chapter_number}

A quick search through the code shows that this is also an issue in these places:
./openlp/core/ui/formattingtagcontroller.py:149:
                return translate('OpenLP.FormattingTagForm', 'Start tag %s is not valid HTML' % start_html), None
./openlp/plugins/bibles/lib/opensong.py:126:
                        translate('BiblesPlugin.Opensong', 'Importing %(bookname)s %(chapter)s...' %
./openlp/plugins/bibles/lib/osis.py:157:
                            translate('BiblesPlugin.OsisImport', 'Importing %(bookname)s %(chapter)s...' %
./openlp/plugins/bibles/lib/osis.py:167:
                                translate('BiblesPlugin.OsisImport', 'Importing %(bookname)s %(chapter)s...' %
./openlp/plugins/bibles/lib/zefania.py:105:
                        translate('BiblesPlugin.Zefnia', 'Importing %(bookname)s %(chapter)s...' %

Traceback (most recent call last):
File "/usr/share/openlp/openlp/core/ui/wizard.py", line 216, in on_current_id_changed
self.perform_wizard()
File "/usr/share/openlp/openlp/plugins/bibles/forms/bibleimportform.py", line 599, in perform_wizard
if importer.do_import(license_version):
File "/usr/share/openlp/openlp/plugins/bibles/lib/opensong.py", line 127, in do_import
{'bookname': db_book.name, 'chapter': chapter_number}))
File "/usr/share/openlp/openlp/core/common/__init__.py", line 107, in translate
return qt_translate(context, text, comment, encoding, n)
TypeError: function takes exactly 5 arguments (1 given)

Related branches

Phill (phill-ridout) on 2015-02-25
Changed in openlp:
importance: Undecided → Low
Tomas Groth (tomasgroth) on 2015-02-27
Changed in openlp:
assignee: nobody → Tomas Groth (tomasgroth)
status: New → In Progress
Tim Bentley (trb143) on 2015-03-11
Changed in openlp:
milestone: none → 2.1.4
status: In Progress → Fix Committed
Tim Bentley (trb143) on 2015-04-26
Changed in openlp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers