← Back to team overview

openlp-core team mailing list archive

[Bug 1425035] [NEW] Wrong use of translation causes crash in opensong bible import

 

Public bug reported:

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)

** Affects: openlp
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1425035

Title:
  Wrong use of translation causes crash in opensong bible import

Status in OpenLP - Worship Presentation Software:
  New

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1425035/+subscriptions


Follow ups

References