Ejemplo n.º 1
0
def getTranslationPageHtml(translationLocale, translator, action,
                           reqPath, userLocale):
  translationPageTemplateValue = { 'reqPath': reqPath }

  # extract translation information and then do xslt
  transformedHtml, translationPageTemplateValue['trInfo'] = \
      translationXslt2(action, translationLocale, translator)

  # move notes to the bottom of the page
  processNotes(transformedHtml)

  # get innerHTML of body
  translationPageTemplateValue['body'] = etree.tostring(
                                    transformedHtml.find('body'))[6:-7]

  template = getJinja2Env(userLocale).get_template('translationPage.html')
  return template.render(translationPageTemplateValue);