Exemplo n.º 1
0
def add_custom_stdvars(variables):
    return variables.update({
        'gettext': _,
        "lang": get_locale(),
        'available_languages': available_languages(),
        'fas_version': release.VERSION
    })
Exemplo n.º 2
0
def add_custom_stdvars(variables):
    return variables.update({
        'gettext': _,
        "lang": get_locale(),
        'available_languages': available_languages(),
        'fas_version': release.VERSION,
        'webmaster_email': config.get('webmaster_email')
    })
Exemplo n.º 3
0
 def language(self, locale):
     if locale not in available_languages():
         turbogears.flash(_('The language \'%s\' is not available.') % locale)
         redirect(request.headers.get("Referer", "/"))
         return dict()
     #turbogears.i18n.set_session_locale(locale)
     cherrypy.response.simple_cookie['fas_locale'] = locale
     redirect(request.headers.get("Referer", "/"))
     return dict()
Exemplo n.º 4
0
 def language(self, locale):
     if locale not in available_languages():
         turbogears.flash(_('The language \'%s\' is not available.') % locale)
         redirect(request.headers.get("Referer", "/"))
         return dict()
     #turbogears.i18n.set_session_locale(locale)
     cherrypy.response.simple_cookie['fas_locale'] = locale
     redirect(request.headers.get("Referer", "/"))
     return dict()
Exemplo n.º 5
0
 def validate_python(self, value, state):
     # pylint: disable-msg=C0111
     if value not in available_languages() + ['C']:
         raise validators.Invalid(
             self.message('not_available', state, lang=value), value, state)
Exemplo n.º 6
0
 def validate_python(self, value, state):
     # pylint: disable-msg=C0111
     if value not in available_languages() + ['C']:
         raise validators.Invalid(self.message('not_available', state, lang=value),
                 value, state)
Exemplo n.º 7
0
def add_custom_stdvars(variables):
    return variables.update({'gettext': _, "lang": get_locale(),
    'available_languages': available_languages(),
    'fas_version': release.VERSION,
    'webmaster_email': config.get('webmaster_email')})
Exemplo n.º 8
0
def add_custom_stdvars(variables):
    return variables.update({'gettext': _, "lang": get_locale(),
    'available_languages': available_languages(), 
    'fas_version': release.VERSION})