Exemple #1
0
def get_locale():
    key = _validate('locale', request.args.get('locale'))
    return LANGUAGES.has_key(key) and LANGUAGES.get(key)[0] or DEFAUL_LANGUAGE
Exemple #2
0
 def locale(self):
   if self.request.get('lang'):
     return self.request.get('lang')
   else:
     return LANGUAGES.get(self.request.headers.get('X-AppEngine-Country')) or 'en'