openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #08240
[Merge] lp:~googol-hush/openlp/fixes2 into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/fixes2 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/fixes2/+merge/58910
Hello,
- fixed standard buttons (Cancel, OK, ...) and standard menu entries (Copy, Cut, Paste, ...) not being translated
Background information:
Qt provides translations of some strings for example for standard buttons (/usr/share/qt4/translations). These buttons are currently not translated. We have to create a second QTranslator [1].
Important:
This is NOT ready to be merged because, the code currently assumes that the qt_<lang>.qm files are in same folder as our own translation files (which is not the case).
[1] http://www.qtcentre.org/threads/16714-QDialogButtonBox-translation-of-standard-button-text-%28-quot-OK-quot-quot-Cancel-quot-etc.%29?p=84102#post84102
--
https://code.launchpad.net/~googol-hush/openlp/fixes2/+merge/58910
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/fixes2 into lp:openlp.
=== modified file 'openlp.pyw'
--- openlp.pyw 2011-04-15 21:43:59 +0000
+++ openlp.pyw 2011-04-24 16:22:27 +0000
@@ -240,8 +240,14 @@
+ "/qt4_plugins")
# i18n Set Language
language = LanguageManager.get_language()
- appTranslator = LanguageManager.get_translator(language)
- app.installTranslator(appTranslator)
+ app_translator, default_translator = \
+ LanguageManager.get_translator(language)
+ if not app_translator.isEmpty():
+ app.installTranslator(app_translator)
+ if not default_translator.isEmpty():
+ app.installTranslator(default_translator)
+ else:
+ log.debug(u'Could not find default_translator.')
if not options.no_error_form:
sys.excepthook = app.hookException
sys.exit(app.run())
@@ -250,4 +256,5 @@
"""
Instantiate and run the application.
"""
- main()
\ No newline at end of file
+ main()
+
=== modified file 'openlp/core/utils/languagemanager.py'
--- openlp/core/utils/languagemanager.py 2011-04-03 13:35:58 +0000
+++ openlp/core/utils/languagemanager.py 2011-04-24 16:22:27 +0000
@@ -55,8 +55,11 @@
language = QtCore.QLocale.system().name()
lang_path = AppLocation.get_directory(AppLocation.LanguageDir)
app_translator = QtCore.QTranslator()
- if app_translator.load(language, lang_path):
- return app_translator
+ app_translator.load(language, lang_path)
+ # A translator for buttons and other default strings provided by Qt.
+ default_translator = QtCore.QTranslator()
+ default_translator.load(u'qt_%s' % language, lang_path)
+ return app_translator, default_translator
@staticmethod
def find_qm_files():
Follow ups