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

Missing localizable (gettext) messages from some files in translation workflow #3412

Closed
return42 opened this issue Apr 21, 2024 · 2 comments · Fixed by #3413
Closed

Missing localizable (gettext) messages from some files in translation workflow #3412

return42 opened this issue Apr 21, 2024 · 2 comments · Fixed by #3413
Labels
bug Something isn't working

Comments

@return42
Copy link
Member

I noticed that we use terms such as

f"<tr><td><b>{gettext('Temperature')}</b></td>"

res += f"<tr><td>{gettext('Humidity')}</td><td>{condition['humidity']}%</td></tr>"

But for some reason they seem to be missing in our translation workflow ... search for "Temperature" on Weblate ..

May we have a bug in our translation workflow ..

Originally posted by @return42 in #3359 (review)


I'm not sure, but it seems to me that pybabel doesn't find (all?) gettext passages in the engines?

# update messages.pot in the master branch
build_msg BABEL 'extract messages from source files and generate POT file'
pybabel extract -F babel.cfg \
-o "${messages_pot}" \
"searx/"

searxng/babel.cfg

Lines 1 to 6 in af3be2b

[extractors]
searxng_msg = searx.babel_extract.extract
[ignore: **/node_modules/**]
[python: **.py]
[jinja2: **/templates/**.html]
[searxng_msg: **/searxng.msg]

@return42 return42 added the bug Something isn't working label Apr 21, 2024
@dalf
Copy link
Member

dalf commented Apr 21, 2024

f-string are not supported [1] but there is no error [2].

[1] python-babel/babel#594
[2] python-babel/babel#715

return42 added a commit to return42/searxng that referenced this issue Apr 21, 2024
To test this patch I used .. and checked the diff of the `messages.pot` file::

    $ ./manage pyenv.cmd pybabel extract -F babel.cfg \
              -o ./searx/translations/messages.pot searx/
    $ git diff ./searx/translations/messages.pot

----

hint from @dalf: f-string are not supported [1] but there is no error [2].

searx/translations/messages.pot

[1] python-babel/babel#594
[2] python-babel/babel#715

Closes: searxng#3412
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit to return42/searxng that referenced this issue Apr 21, 2024
To test this patch I used .. and checked the diff of the `messages.pot` file::

    $ ./manage pyenv.cmd pybabel extract -F babel.cfg \
              -o ./searx/translations/messages.pot searx/
    $ git diff ./searx/translations/messages.pot

----

hint from @dalf: f-string are not supported [1] but there is no error [2].

[1] python-babel/babel#594
[2] python-babel/babel#715

Closes: searxng#3412
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
@return42
Copy link
Member Author

f-string are not supported

Thanks for pointing out .. / see my PR:

return42 added a commit that referenced this issue Apr 26, 2024
To test this patch I used .. and checked the diff of the `messages.pot` file::

    $ ./manage pyenv.cmd pybabel extract -F babel.cfg \
              -o ./searx/translations/messages.pot searx/
    $ git diff ./searx/translations/messages.pot

----

hint from @dalf: f-string are not supported [1] but there is no error [2].

[1] python-babel/babel#594
[2] python-babel/babel#715

Closes: #3412
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
VieuL pushed a commit to VieuL/searxng that referenced this issue Jul 5, 2024
To test this patch I used .. and checked the diff of the `messages.pot` file::

    $ ./manage pyenv.cmd pybabel extract -F babel.cfg \
              -o ./searx/translations/messages.pot searx/
    $ git diff ./searx/translations/messages.pot

----

hint from @dalf: f-string are not supported [1] but there is no error [2].

[1] python-babel/babel#594
[2] python-babel/babel#715

Closes: searxng#3412
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.

2 participants