forked from openlp/openlp
Moved the translation files to their proper place on Linux/BSD/*nix.
This commit is contained in:
parent
4ad32acc82
commit
192a3de2ad
@ -35,6 +35,7 @@ import urllib2
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
|
|
||||||
if sys.platform != u'win32' and sys.platform != u'darwin':
|
if sys.platform != u'win32' and sys.platform != u'darwin':
|
||||||
try:
|
try:
|
||||||
from xdg import BaseDirectory
|
from xdg import BaseDirectory
|
||||||
@ -134,7 +135,7 @@ class AppLocation(object):
|
|||||||
elif dir_type == AppLocation.LanguageDir:
|
elif dir_type == AppLocation.LanguageDir:
|
||||||
app_path = _get_frozen_path(
|
app_path = _get_frozen_path(
|
||||||
os.path.abspath(os.path.split(sys.argv[0])[0]),
|
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')
|
return os.path.join(app_path, u'i18n')
|
||||||
else:
|
else:
|
||||||
return _get_os_dir_path(dir_type)
|
return _get_os_dir_path(dir_type)
|
||||||
@ -169,15 +170,21 @@ def _get_os_dir_path(dir_type):
|
|||||||
if dir_type == AppLocation.DataDir:
|
if dir_type == AppLocation.DataDir:
|
||||||
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
|
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
|
||||||
u'openlp', u'data')
|
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),
|
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
|
||||||
u'openlp')
|
u'openlp')
|
||||||
elif sys.platform == u'darwin':
|
elif sys.platform == u'darwin':
|
||||||
if dir_type == AppLocation.DataDir:
|
if dir_type == AppLocation.DataDir:
|
||||||
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||||
u'Library', u'Application Support', u'openlp', u'Data')
|
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),
|
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||||
u'Library', u'Application Support', u'openlp')
|
u'Library', u'Application Support', u'openlp')
|
||||||
else:
|
else:
|
||||||
|
if dir_type == AppLocation.LanguageDir:
|
||||||
|
return os.path.join(u'/usr', u'share', u'openlp')
|
||||||
if XDG_BASE_AVAILABLE:
|
if XDG_BASE_AVAILABLE:
|
||||||
if dir_type == AppLocation.ConfigDir:
|
if dir_type == AppLocation.ConfigDir:
|
||||||
return os.path.join(unicode(BaseDirectory.xdg_config_home,
|
return os.path.join(unicode(BaseDirectory.xdg_config_home,
|
||||||
|
@ -63,6 +63,8 @@ class LanguageManager(object):
|
|||||||
"""
|
"""
|
||||||
Find all available language files in this OpenLP install
|
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(
|
trans_dir = QtCore.QDir(AppLocation.get_directory(
|
||||||
AppLocation.LanguageDir))
|
AppLocation.LanguageDir))
|
||||||
file_names = trans_dir.entryList(QtCore.QStringList(u'*.qm'),
|
file_names = trans_dir.entryList(QtCore.QStringList(u'*.qm'),
|
||||||
|
@ -2,12 +2,16 @@
|
|||||||
# -*- makefile -*-
|
# -*- makefile -*-
|
||||||
|
|
||||||
build:
|
build:
|
||||||
mkdir -p openlp/i18n
|
mkdir -p resources/i18n/qm
|
||||||
for TSFILE in resources/i18n/*.ts; do\
|
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
|
done
|
||||||
|
|
||||||
install:
|
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:
|
clean:
|
||||||
|
rm -fR resources/i18n/qm
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
DEB_PYTHON_SYSTEM := pysupport
|
DEB_PYTHON_SYSTEM := pysupport
|
||||||
DEB_MAKE_BUILD_TARGET := build
|
DEB_MAKE_BUILD_TARGET := build
|
||||||
DEB_MAKE_INSTALL_TARGET :=
|
DEB_MAKE_INSTALL_TARGET := install
|
||||||
DEB_MAKE_CLEAN_TARGET :=
|
DEB_MAKE_CLEAN_TARGET := clean
|
||||||
|
|
||||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
include /usr/share/cdbs/1/rules/debhelper.mk
|
||||||
include /usr/share/cdbs/1/class/python-distutils.mk
|
include /usr/share/cdbs/1/class/python-distutils.mk
|
||||||
|
Loading…
Reference in New Issue
Block a user