Merge lp:~trb143/openlp/bugfixes into lp:openlp

Proposed by Tim Bentley
Status: Merged
Merged at revision: 1029
Proposed branch: lp:~trb143/openlp/bugfixes
Merge into: lp:openlp
Diff against target: 38 lines (+7/-3)
2 files modified
openlp/core/utils/__init__.py (+5/-1)
openlp/core/utils/languagemanager.py (+2/-2)
To merge this branch: bzr merge lp:~trb143/openlp/bugfixes
Reviewer Review Type Date Requested Status
Raoul Snyman approve Approve
Review via email: mp+35222@code.launchpad.net

Description of the change

Test deployed a weekly build to a Fedora VM with *.qm files in openlp/i18n directory.

Files not found due to directory location /usr/bin as the application location. Code fixed to point back to correct place under site packages.

Adjusted language path accordingly.

Tested on local box (this patch)

Deployed box (hand coded to get working).

Display openlp translated in foreign languages .

To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

I was just going through some of this exact code, and thinking that it needs a bit of a cleanup.

review: Approve (approve)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py 2010-08-26 13:54:05 +0000
+++ openlp/core/utils/__init__.py 2010-09-12 09:19:45 +0000
@@ -112,7 +112,11 @@
112 The directory type you want, for instance the data directory.112 The directory type you want, for instance the data directory.
113 """113 """
114 if dir_type == AppLocation.AppDir:114 if dir_type == AppLocation.AppDir:
115 return os.path.abspath(os.path.split(sys.argv[0])[0])115 if hasattr(sys, u'frozen') and sys.frozen == 1:
116 app_path = os.path.abspath(os.path.split(sys.argv[0])[0])
117 else:
118 app_path = os.path.split(openlp.__file__)[0]
119 return app_path
116 elif dir_type == AppLocation.ConfigDir:120 elif dir_type == AppLocation.ConfigDir:
117 if sys.platform == u'win32':121 if sys.platform == u'win32':
118 path = os.path.join(os.getenv(u'APPDATA'), u'openlp')122 path = os.path.join(os.getenv(u'APPDATA'), u'openlp')
119123
=== modified file 'openlp/core/utils/languagemanager.py'
--- openlp/core/utils/languagemanager.py 2010-09-11 15:58:03 +0000
+++ openlp/core/utils/languagemanager.py 2010-09-12 09:19:45 +0000
@@ -55,7 +55,7 @@
55 if LanguageManager.AutoLanguage:55 if LanguageManager.AutoLanguage:
56 language = QtCore.QLocale.system().name()56 language = QtCore.QLocale.system().name()
57 lang_path = AppLocation.get_directory(AppLocation.AppDir)57 lang_path = AppLocation.get_directory(AppLocation.AppDir)
58 lang_path = os.path.join(lang_path, u'resources', u'i18n')58 lang_path = os.path.join(lang_path, u'i18n')
59 app_translator = QtCore.QTranslator()59 app_translator = QtCore.QTranslator()
60 if app_translator.load("openlp_" + language, lang_path):60 if app_translator.load("openlp_" + language, lang_path):
61 return app_translator61 return app_translator
@@ -66,7 +66,7 @@
66 Find all available language files in this OpenLP install66 Find all available language files in this OpenLP install
67 """67 """
68 trans_dir = AppLocation.get_directory(AppLocation.AppDir)68 trans_dir = AppLocation.get_directory(AppLocation.AppDir)
69 trans_dir = QtCore.QDir(os.path.join(trans_dir, u'openlp', u'i18n'))69 trans_dir = QtCore.QDir(os.path.join(trans_dir, u'i18n'))
70 file_names = trans_dir.entryList(QtCore.QStringList("*.qm"),70 file_names = trans_dir.entryList(QtCore.QStringList("*.qm"),
71 QtCore.QDir.Files, QtCore.QDir.Name)71 QtCore.QDir.Files, QtCore.QDir.Name)
72 for name in file_names:72 for name in file_names: