Beispiel #1
0
def add_custom_stdvars(variables):
    return variables.update({
        'gettext': _,
        "lang": get_locale(),
        'available_languages': available_languages(),
        'fas_version': release.VERSION
    })
Beispiel #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')
    })
Beispiel #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()
Beispiel #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()
Beispiel #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)
Beispiel #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)
Beispiel #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')})
Beispiel #8
0
def add_custom_stdvars(variables):
    return variables.update({'gettext': _, "lang": get_locale(),
    'available_languages': available_languages(), 
    'fas_version': release.VERSION})