* unicode fix
This commit is contained in:
@@ -773,7 +773,7 @@ Gives a brief list of PiSi components published in the repository.
|
|||||||
pstr = p
|
pstr = p
|
||||||
if p in installed_list:
|
if p in installed_list:
|
||||||
pstr = colorize(p, "cyan")
|
pstr = colorize(p, "cyan")
|
||||||
ctx.ui.info('%15s - %s ' % (pstr, package.summary))
|
ctx.ui.info('%15s - %s ' % (pstr, unicode(package.summary)))
|
||||||
|
|
||||||
|
|
||||||
class ListUpgrades(Command):
|
class ListUpgrades(Command):
|
||||||
|
|||||||
+13
-5
@@ -116,6 +116,7 @@ class LocalText(dict):
|
|||||||
langs = [ locale.getlocale()[0][0:2], 'tr', 'en' ]
|
langs = [ locale.getlocale()[0][0:2], 'tr', 'en' ]
|
||||||
if not util.any(lambda x : self.has_key(x), langs):
|
if not util.any(lambda x : self.has_key(x), langs):
|
||||||
errs.append( where + _("Tag should have at least an English or Turkish version"))
|
errs.append( where + _("Tag should have at least an English or Turkish version"))
|
||||||
|
#FIXME: check if all entries are unicode
|
||||||
return errs
|
return errs
|
||||||
|
|
||||||
def format(self, f, errs):
|
def format(self, f, errs):
|
||||||
@@ -142,11 +143,18 @@ class LocalText(dict):
|
|||||||
ctx.ui.warning(x)
|
ctx.ui.warning(x)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
strfile = StringIO()
|
L = locale.getlocale()[0][0:2] # try to read language, pathetic isn't it?
|
||||||
self.print_text(strfile)
|
if self.has_key(L):
|
||||||
str = strfile.getvalue()
|
return unicode(self[L])
|
||||||
strfile.close()
|
elif self.has_key('en'):
|
||||||
return str
|
# fallback to English, blah
|
||||||
|
return unicode(self['en'])
|
||||||
|
elif self.has_key('tr'):
|
||||||
|
# fallback to Turkish
|
||||||
|
return unicode(self['tr'])
|
||||||
|
else:
|
||||||
|
return ''
|
||||||
|
#ctx.ui.warning(_("Tag should have at least an English or Turkish version"))
|
||||||
|
|
||||||
class Writer(formatter.DumbWriter):
|
class Writer(formatter.DumbWriter):
|
||||||
"""adds unicode support"""
|
"""adds unicode support"""
|
||||||
|
|||||||
Reference in New Issue
Block a user