i18n tamam. iki eksik var:
1. setup.py içindeki kısım düzeltilmeli (boş bi zamanımda yapıcam, bana bırakın) 2. pisi içinde bişiler unicode stringleri basamadıkları için aptal python hataları çıkıyor. ben sadece cli/__init__ içindeki ui'deki output'u düzelttim, bunun neden olduğuna bakıp hallediverin. normalde her yerde unicode kullanabilmemiz lazım çıktılarda.
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ if ver[0] <= 2 and ver[1] < 4:
|
|||||||
|
|
||||||
import gettext
|
import gettext
|
||||||
__trans = gettext.translation('pisi', fallback=True)
|
__trans = gettext.translation('pisi', fallback=True)
|
||||||
_ = __trans.lgettext
|
_ = __trans.ugettext
|
||||||
|
|
||||||
import pisi
|
import pisi
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class CLI(UI):
|
|||||||
super(CLI, self).__init__(show_debug, show_verbose)
|
super(CLI, self).__init__(show_debug, show_verbose)
|
||||||
|
|
||||||
def output(self, str):
|
def output(self, str):
|
||||||
sys.stdout.write(str)
|
sys.stdout.write(str.encode("utf-8"))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
def info(self, msg, verbose = False, noln = False):
|
def info(self, msg, verbose = False, noln = False):
|
||||||
|
|||||||
@@ -13,7 +13,10 @@
|
|||||||
# Install script for tengis.
|
# Install script for tengis.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
from distutils.command.install import install
|
||||||
|
|
||||||
PISI_VERSION = "0.1"
|
PISI_VERSION = "0.1"
|
||||||
|
|
||||||
@@ -38,6 +41,14 @@ def getVersion():
|
|||||||
else:
|
else:
|
||||||
return PISI_VERSION
|
return PISI_VERSION
|
||||||
|
|
||||||
|
class InstallPisi(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")
|
||||||
|
|
||||||
setup(name="pisi",
|
setup(name="pisi",
|
||||||
version= getVersion(),
|
version= getVersion(),
|
||||||
description="PISI (Packages Installed Successfully as Intended)",
|
description="PISI (Packages Installed Successfully as Intended)",
|
||||||
@@ -49,5 +60,8 @@ setup(name="pisi",
|
|||||||
package_dir = {'': ''},
|
package_dir = {'': ''},
|
||||||
packages = ['pisi', 'pisi.cli', 'pisi.actionsapi'],
|
packages = ['pisi', 'pisi.cli', 'pisi.actionsapi'],
|
||||||
data_files = [ ('/usr/share/locale/tr/LC_MESSAGES', ['po/tr/pisi.mo'])],
|
data_files = [ ('/usr/share/locale/tr/LC_MESSAGES', ['po/tr/pisi.mo'])],
|
||||||
scripts = ['pisi-cli']
|
scripts = ['pisi-cli'],
|
||||||
|
cmdclass = {
|
||||||
|
'install' : InstallPisi
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user