src/cm/utils/i18n.py
author gibus
Mon, 07 May 2012 09:10:45 +0200
changeset 415 bacf162c7b58
parent 0 40c8f766c9b8
permissions -rw-r--r--
Adds api/convert to return HTML document from legacy format + Saves attached images when just converting to HTML, without creating a text + Returns nb of detached and removed commentswhen updating text.

from django.utils.translation.trans_real import translation

def translate_to(value, language_code):
    t = translation(language_code)    
    return getattr(t, 'gettext')(value)