Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL percent-encoding in translations fail in babel #2482

Closed
return42 opened this issue Jun 2, 2023 · 0 comments · Fixed by #2483
Closed

URL percent-encoding in translations fail in babel #2482

return42 opened this issue Jun 2, 2023 · 0 comments · Fixed by #2483
Labels
bug Something isn't working

Comments

@return42
Copy link
Member

return42 commented Jun 2, 2023

URL encoding, officially known as percent-encoding in translated strings cause "Server error" when opening the preference page ..

...
  File "searx/templates/simple/preferences/method.html", line 14, in top-level template code
    {{- _('Change how forms are submitted, <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="external">learn more about request methods</a>') -}}
  File "py3/lib/python3.8/site-packages/jinja2/ext.py", line 167, in _gettext_alias
    return __context.call(__context.resolve("gettext"), *args, **kwargs)
  File "py3/lib/python3.8/site-packages/jinja2/ext.py", line 179, in gettext
    return rv % variables  # type: ignore
  File "/py3/lib/python3.8/site-packages/markupsafe/__init__.py", line 115, in __mod__
    return self.__class__(super().__mod__(arg))
ValueError: unsupported format character 'C' (0x43) at index 75

We have this issue with all UI languages that have a translation with a percentage URL:

<div class="description">{{ _('Change how forms are submitted, <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="external">learn more about request methods</a>') }}</div>

@return42 return42 added the bug Something isn't working label Jun 2, 2023
return42 added a commit to return42/searxng that referenced this issue Jun 2, 2023
Closes: searxng#2482
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit that referenced this issue Jun 2, 2023
Closes: #2482
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant