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
|
||||
__trans = gettext.translation('pisi', fallback=True)
|
||||
_ = __trans.lgettext
|
||||
_ = __trans.ugettext
|
||||
|
||||
import pisi
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class CLI(UI):
|
||||
super(CLI, self).__init__(show_debug, show_verbose)
|
||||
|
||||
def output(self, str):
|
||||
sys.stdout.write(str)
|
||||
sys.stdout.write(str.encode("utf-8"))
|
||||
sys.stdout.flush()
|
||||
|
||||
def info(self, msg, verbose = False, noln = False):
|
||||
|
||||
@@ -13,7 +13,10 @@
|
||||
# Install script for tengis.
|
||||
#
|
||||
|
||||
import os
|
||||
import shutil
|
||||
from distutils.core import setup
|
||||
from distutils.command.install import install
|
||||
|
||||
PISI_VERSION = "0.1"
|
||||
|
||||
@@ -38,16 +41,27 @@ def getVersion():
|
||||
else:
|
||||
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",
|
||||
version= getVersion(),
|
||||
description="PISI (Packages Installed Successfully as Intended)",
|
||||
long_description="PISI is the package management system of Pardus Linux.",
|
||||
license="GNU GPL2",
|
||||
author="Pardus Developers",
|
||||
author_email="pisi@uludag.org.tr",
|
||||
url="http://www.uludag.org.tr/eng/pisi/",
|
||||
package_dir = {'': ''},
|
||||
packages = ['pisi', 'pisi.cli', 'pisi.actionsapi'],
|
||||
data_files = [ ('/usr/share/locale/tr/LC_MESSAGES', ['po/tr/pisi.mo'])],
|
||||
scripts = ['pisi-cli']
|
||||
)
|
||||
version= getVersion(),
|
||||
description="PISI (Packages Installed Successfully as Intended)",
|
||||
long_description="PISI is the package management system of Pardus Linux.",
|
||||
license="GNU GPL2",
|
||||
author="Pardus Developers",
|
||||
author_email="pisi@uludag.org.tr",
|
||||
url="http://www.uludag.org.tr/eng/pisi/",
|
||||
package_dir = {'': ''},
|
||||
packages = ['pisi', 'pisi.cli', 'pisi.actionsapi'],
|
||||
data_files = [ ('/usr/share/locale/tr/LC_MESSAGES', ['po/tr/pisi.mo'])],
|
||||
scripts = ['pisi-cli'],
|
||||
cmdclass = {
|
||||
'install' : InstallPisi
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user