i18n desteğini jenerik hale getirdim, setup.py içindeki
i18n_languages stringine dil kodunu ekleyerek diğer diller de desteklenebilir kolayca.
This commit is contained in:
@@ -9,10 +9,6 @@
|
|||||||
#
|
#
|
||||||
# Please read the COPYING file.
|
# Please read the COPYING file.
|
||||||
|
|
||||||
#
|
|
||||||
# Install script for tengis.
|
|
||||||
#
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
@@ -41,13 +37,17 @@ def getVersion():
|
|||||||
else:
|
else:
|
||||||
return PISI_VERSION
|
return PISI_VERSION
|
||||||
|
|
||||||
class InstallPisi(install):
|
i18n_domain = "pisi"
|
||||||
|
i18n_languages = "tr"
|
||||||
|
|
||||||
|
class I18nInstall(install):
|
||||||
def run(self):
|
def run(self):
|
||||||
install.run(self)
|
install.run(self)
|
||||||
# FIXME: refactor this into a generic i18n function
|
for lang in i18n_languages.split(' '):
|
||||||
# and take po names and install dir from options
|
print "Installing '%s' translations..." % lang
|
||||||
os.popen("msgfmt po/tr.po -o po/tr.mo")
|
os.popen("msgfmt po/%s.po -o po/%s.mo" % (lang, lang))
|
||||||
shutil.copy("po/tr.mo", "/usr/share/locale/tr/LC_MESSAGES/pisi.mo")
|
shutil.copy("po/%s.mo" % lang,
|
||||||
|
"/usr/share/locale/%s/LC_MESSAGES/%s.mo" % (lang, i18n_domain))
|
||||||
|
|
||||||
setup(name="pisi",
|
setup(name="pisi",
|
||||||
version= getVersion(),
|
version= getVersion(),
|
||||||
@@ -61,6 +61,6 @@ setup(name="pisi",
|
|||||||
packages = ['pisi', 'pisi.cli', 'pisi.actionsapi'],
|
packages = ['pisi', 'pisi.cli', 'pisi.actionsapi'],
|
||||||
scripts = ['pisi-cli'],
|
scripts = ['pisi-cli'],
|
||||||
cmdclass = {
|
cmdclass = {
|
||||||
'install' : InstallPisi
|
'install' : I18nInstall
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user