From 708577215dbbc5dca9455770a64271e7aa1575e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrer=20=C3=96zen?= Date: Tue, 4 Oct 2005 20:50:46 +0000 Subject: [PATCH] =?UTF-8?q?i18n=20deste=C4=9Fini=20jenerik=20hale=20getird?= =?UTF-8?q?im,=20setup.py=20i=C3=A7indeki=20i18n=5Flanguages=20stringine?= =?UTF-8?q?=20dil=20kodunu=20ekleyerek=20di=C4=9Fer=20diller=20de=20destek?= =?UTF-8?q?lenebilir=20kolayca.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index bdbb603c..083b365e 100755 --- a/setup.py +++ b/setup.py @@ -9,10 +9,6 @@ # # Please read the COPYING file. -# -# Install script for tengis. -# - import os import shutil from distutils.core import setup @@ -41,13 +37,17 @@ def getVersion(): else: return PISI_VERSION -class InstallPisi(install): +i18n_domain = "pisi" +i18n_languages = "tr" + +class I18nInstall(install): def run(self): install.run(self) - # FIXME: refactor this into a generic i18n function - # and take po names and install dir from options - os.popen("msgfmt po/tr.po -o po/tr.mo") - shutil.copy("po/tr.mo", "/usr/share/locale/tr/LC_MESSAGES/pisi.mo") + for lang in i18n_languages.split(' '): + print "Installing '%s' translations..." % lang + os.popen("msgfmt po/%s.po -o po/%s.mo" % (lang, lang)) + shutil.copy("po/%s.mo" % lang, + "/usr/share/locale/%s/LC_MESSAGES/%s.mo" % (lang, i18n_domain)) setup(name="pisi", version= getVersion(), @@ -61,6 +61,6 @@ setup(name="pisi", packages = ['pisi', 'pisi.cli', 'pisi.actionsapi'], scripts = ['pisi-cli'], cmdclass = { - 'install' : InstallPisi + 'install' : I18nInstall } )