← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~gerald-britton/openlp/tweaks into lp:openlp

 

jerryb has proposed merging lp:~gerald-britton/openlp/tweaks into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~gerald-britton/openlp/tweaks/+merge/59809

Do lookup of QtCore.QCoreApplication.translate in function definition to save lookups at run time.
-- 
https://code.launchpad.net/~gerald-britton/openlp/tweaks/+merge/59809
Your team OpenLP Core is requested to review the proposed merge of lp:~gerald-britton/openlp/tweaks into lp:openlp.
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2011-05-01 15:15:08 +0000
+++ openlp/core/lib/__init__.py	2011-05-03 17:49:07 +0000
@@ -85,7 +85,8 @@
     u'end tag': u'{/u}', u'end html': u'</span>', u'protected': True})
 
 def translate(context, text, comment=None,
-    encoding=QtCore.QCoreApplication.CodecForTr, n=-1):
+    encoding=QtCore.QCoreApplication.CodecForTr, n=-1,
+    translate=QtCore.QCoreApplication.translate):
     """
     A special shortcut method to wrap around the Qt4 translation functions.
     This abstracts the translation procedure so that we can change it if at a
@@ -102,8 +103,7 @@
         An identifying string for when the same text is used in different roles
         within the same context.
     """
-    return QtCore.QCoreApplication.translate(
-        context, text, comment, encoding, n)
+    return translate(context, text, comment, encoding, n)
 
 def get_text_file_string(text_file):
     """


Follow ups