From: Leandro Lucarella Date: Sun, 11 Mar 2007 22:26:31 +0000 (+0000) Subject: Agregar función tg.strbool() a KID para imprimir booleanos en castellano. X-Git-Tag: 0_9~51 X-Git-Url: https://git.llucax.com/software/sercom.git/commitdiff_plain/059c54471d9a4d943c525821760f4321ad6f70e8?ds=sidebyside Agregar función tg.strbool() a KID para imprimir booleanos en castellano. --- diff --git a/sercom/controllers.py b/sercom/controllers.py index 8930478..3bd0d8a 100644 --- a/sercom/controllers.py +++ b/sercom/controllers.py @@ -164,8 +164,13 @@ def summarize(text, size, concat=True, continuation='...'): text = text[:size-len(continuation)] + continuation return text +def strbool(bool): + if bool: + return _(u'Sí') + return _(u'No') + def add_custom_stdvars(vars): - return vars.update(dict(summarize=summarize)) + return vars.update(dict(summarize=summarize, strbool=strbool)) view.variable_providers.append(add_custom_stdvars) #}}}