Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

118
Visualizações
Flask Babelex 0.9.4 and % escaping

In a Flask application we recently upgraded Werkzeug to 1.0.1 (so we could set the same site on cookies), which forced a few dependencies, among which Flask-BabelEx==0.9.4.

After this upgrade, the handling of escaped % (percent signs) changed in a very troubling way. Where gettext('foo %%') used to return *"foo %"*, it now returns *"foo %%"*, in other words, the escaping of % sign seems to not be handled. I thought, ok, a little upward incompatibility, we just have to replace all the %% by % in babel strings (in reference language as well as in all translations, so that's a big deal already).

But that's not the end of the story, because for all babel strings used within Jinja2 templates, such as {{ _("This is a percent sign: %") }}, the escaping of % signs is still handled, so this still needs to be {{ _("This is a percent sign: %%") }}. So do we have to handle both %-escaped and unescaped babel strings depending on where they are used? Is there a setting somewhere that would alleviate this escaping issue.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda