← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~raoul-snyman/openlp/i18n-directories into lp:openlp

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/i18n-directories into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/i18n-directories/+merge/53118

Putting the i18n files in openlp/i18n is incorrect on Linux/BSD/*nix, they belong in /usr/share/openlp/i18n. This proposal fixes that.
-- 
https://code.launchpad.net/~raoul-snyman/openlp/i18n-directories/+merge/53118
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/i18n-directories into lp:openlp.
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py	2011-03-10 13:15:49 +0000
+++ openlp/core/utils/__init__.py	2011-03-12 07:16:17 +0000
@@ -35,6 +35,7 @@
 from datetime import datetime
 
 from PyQt4 import QtGui, QtCore
+
 if sys.platform != u'win32' and sys.platform != u'darwin':
     try:
         from xdg import BaseDirectory
@@ -134,7 +135,7 @@
         elif dir_type == AppLocation.LanguageDir:
             app_path = _get_frozen_path(
                 os.path.abspath(os.path.split(sys.argv[0])[0]),
-                os.path.split(openlp.__file__)[0])
+                _get_os_dir_path(dir_type))
             return os.path.join(app_path, u'i18n')
         else:
             return _get_os_dir_path(dir_type)
@@ -169,15 +170,21 @@
         if dir_type == AppLocation.DataDir:
             return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
                 u'openlp', u'data')
+        elif dir_type == AppLocation.LanguageDir:
+            return os.path.split(openlp.__file__)[0]
         return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
             u'openlp')
     elif sys.platform == u'darwin':
         if dir_type == AppLocation.DataDir:
             return os.path.join(unicode(os.getenv(u'HOME'), encoding),
                 u'Library', u'Application Support', u'openlp', u'Data')
+        elif dir_type == AppLocation.LanguageDir:
+            return os.path.split(openlp.__file__)[0]
         return os.path.join(unicode(os.getenv(u'HOME'), encoding),
             u'Library', u'Application Support', u'openlp')
     else:
+        if dir_type == AppLocation.LanguageDir:
+            return os.path.join(u'/usr', u'share', u'openlp')
         if XDG_BASE_AVAILABLE:
             if dir_type == AppLocation.ConfigDir:
                 return os.path.join(unicode(BaseDirectory.xdg_config_home,

=== modified file 'openlp/core/utils/languagemanager.py'
--- openlp/core/utils/languagemanager.py	2011-03-11 05:15:41 +0000
+++ openlp/core/utils/languagemanager.py	2011-03-12 07:16:17 +0000
@@ -63,6 +63,8 @@
         """
         Find all available language files in this OpenLP install
         """
+        log.debug(u'Translation files: %s', AppLocation.get_directory(
+            AppLocation.LanguageDir))
         trans_dir = QtCore.QDir(AppLocation.get_directory(
             AppLocation.LanguageDir))
         file_names = trans_dir.entryList(QtCore.QStringList(u'*.qm'),

=== modified file 'resources/debian/Makefile'
--- resources/debian/Makefile	2011-03-09 06:55:41 +0000
+++ resources/debian/Makefile	2011-03-12 07:16:17 +0000
@@ -2,12 +2,16 @@
 # -*- makefile -*-
 
 build:
-	mkdir -p openlp/i18n
+	mkdir -p resources/i18n/qm
 	for TSFILE in resources/i18n/*.ts; do\
-	    lrelease-qt4 $$TSFILE -qm openlp/i18n/`basename $$TSFILE .ts`.qm;\
+	    lrelease-qt4 $$TSFILE -qm resources/i18n/qm/`basename $$TSFILE .ts`.qm;\
 	done
 
 install:
+    mkdir -p $(DESTDIR)/usr/share/openlp/i18n
+    cd resources/i18n/qm && for QMFILE in*.qm; do\
+        mv $QMFILE $(DESTDIR)/usr/share/openlp/i18n;\
+    done
 
 clean:
-
+	rm -fR resources/i18n/qm

=== modified file 'resources/debian/debian/rules'
--- resources/debian/debian/rules	2011-03-09 06:55:41 +0000
+++ resources/debian/debian/rules	2011-03-12 07:16:17 +0000
@@ -1,21 +1,21 @@
 #!/usr/bin/make -f
-  
+
 DEB_PYTHON_SYSTEM := pysupport
 DEB_MAKE_BUILD_TARGET := build
-DEB_MAKE_INSTALL_TARGET := 
-DEB_MAKE_CLEAN_TARGET := 
+DEB_MAKE_INSTALL_TARGET := install
+DEB_MAKE_CLEAN_TARGET := clean
 
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/python-distutils.mk
 include /usr/share/cdbs/1/class/makefile.mk
 
 binary-post-install/openlp::
-	for SIZE in 16x16 32x32 48x48 64x64 128x128 256x256; do \
-		mkdir -p debian/openlp/usr/share/icons/hicolor/$$SIZE/apps && \
-		cp resources/images/openlp-logo-$$SIZE.png debian/openlp/usr/share/icons/hicolor/$$SIZE/apps/openlp.png; \
-	done
-	
-	mkdir -p debian/openlp/usr/share/icons/hicolor/scalable/apps && \
-	cp resources/images/openlp-logo.svg debian/openlp/usr/share/icons/hicolor/scalable/apps/openlp.svg
-	
-	cd debian/openlp/usr/bin/ && mv openlp.pyw openlp
+    for SIZE in 16x16 32x32 48x48 64x64 128x128 256x256; do \
+        mkdir -p debian/openlp/usr/share/icons/hicolor/$$SIZE/apps && \
+        cp resources/images/openlp-logo-$$SIZE.png debian/openlp/usr/share/icons/hicolor/$$SIZE/apps/openlp.png; \
+    done
+
+    mkdir -p debian/openlp/usr/share/icons/hicolor/scalable/apps && \
+    cp resources/images/openlp-logo.svg debian/openlp/usr/share/icons/hicolor/scalable/apps/openlp.svg
+
+    cd debian/openlp/usr/bin/ && mv openlp.pyw openlp


Follow ups