Beispiel #1
0
 def get(self, urlLocale=None):
   userLocale = getLocale(urlLocale, self.request.headers.get('accept_language'))
   template_values = getCommonTemplateValues(self, urlLocale, userLocale)
   template_values['isIncludeAbout'] = True
   template_values['pageHtml'] = getAllLocalesTranslationsHtml(
                                   urlLocale, userLocale)
   template = jinja_environment.get_template('index.html')
   self.response.out.write(template.render(template_values))
Beispiel #2
0
 def get(self, urlLocale=None):
     userLocale = getLocale(urlLocale,
                            self.request.headers.get('accept_language'))
     template_values = getCommonTemplateValues(self, urlLocale, userLocale)
     template_values['isIncludeAbout'] = True
     template_values['pageHtml'] = getAllLocalesTranslationsHtml(
         urlLocale, userLocale)
     template = jinja_environment.get_template('index.html')
     self.response.out.write(template.render(template_values))
Beispiel #3
0
def commonMainPage(urlLocale=None):
  if web.ctx.host.split(':')[0] == "epalitipitaka.appspot.com":
    # redirect to new domain
    url = "http://tipitaka.online-dhamma.net" + \
          urllib.quote(web.ctx.path.encode('utf-8')) + \
          web.ctx.query
    raise web.redirect(url)

  userLocale = getLocale(urlLocale, web.ctx.env.get('HTTP_ACCEPT_LANGUAGE'))
  template_values = commonTemplateValues(urlLocale, userLocale)
  template_values['isIncludeAbout'] = True
  template_values['pageHtml'] = getAllLocalesTranslationsHtml(urlLocale, userLocale)
  template = jinja_environment.get_template('index.html')
  return template.render(template_values)
Beispiel #4
0
 def POST(self):
   data = json.loads(web.data())
   checkData(data['urlLocale'], data['userLocale'])
   return getAllLocalesTranslationsHtml(data['urlLocale'], data['userLocale'])