]> git.llucax.com Git - z.facultad/75.52/sercom.git/commitdiff
Agregar función tg.strbool() a KID para imprimir booleanos en castellano.
authorLeandro Lucarella <llucax@gmail.com>
Sun, 11 Mar 2007 22:26:31 +0000 (22:26 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Sun, 11 Mar 2007 22:26:31 +0000 (22:26 +0000)
sercom/controllers.py

index 893047876b7a723f9f8bbeb25a203f32579bf796..3bd0d8af0106f1c392d53eb64e3c607069cb16f2 100644 (file)
@@ -164,8 +164,13 @@ def summarize(text, size, concat=True, continuation='...'):
             text = text[:size-len(continuation)] + continuation
     return text
 
             text = text[:size-len(continuation)] + continuation
     return text
 
+def strbool(bool):
+    if bool:
+        return _(u'Sí')
+    return _(u'No')
+
 def add_custom_stdvars(vars):
 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)
 #}}}
 
 view.variable_providers.append(add_custom_stdvars)
 #}}}