GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add script for handling translations by rffontenelle · Pull Request #195 · python/python-docs-theme

Conversation

@rffontenelle

@rffontenelle rffontenelle commented Aug 1, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This is an initial take on the enable localization initiative adding a script to ease the babel call.

Usage:

python babel_runner.py extract           # generate translations template file (.pot)
python babel_runner.py init -l pt_BR     # generate a translation file (.po) for Brazilian Portuguese
python babel_runner.py update            # update all .po files using the existing .pot; or
python babel_runner.py update -l pt_BR   # update only the pt_BR.po
python babel_runner.py compile           # compile all .po files using the existing .pot; or
python babel_runner.py compile -l pt_BR  # compile only the pt_BR.po

See #194

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rffontenelle
rffontenelle force-pushed the add-localization branch from 0d01316 to fb27bb0 Compare August 2, 2024 02:27
@rffontenelle
Add script for handling translations
d271fac
@rffontenelle
rffontenelle force-pushed the add-localization branch from fb27bb0 to d271fac Compare August 2, 2024 02:28
hugovk
hugovk reviewed Aug 2, 2024
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Please could you add it somehow to the CI, so we know it at least runs without errors?

I was thinking if this script could be converted into Makefile commands, but then we won't have Windows support, so that's no good. But we could add Makefile commands to call this script. This can be left for later though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

rffontenelle added 5 commits August 2, 2024 13:31
@rffontenelle
Make ruff tests happy
634a20c
@rffontenelle
Rename mapping file to .babel.cfg
a809821
@rffontenelle
Forbid initializing existent po
adf715c
@rffontenelle
Extend instead of append list for locale arg
66820a5
@rffontenelle
Add translation tests to tests.yml
6b6f0d2
@rffontenelle

rffontenelle commented Aug 2, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@hugovk workflow job added to tests.yml. My intention is to show the script works, but we can shape it better.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Wulian233
Wulian233 reviewed Aug 3, 2024
View reviewed changes
Comment thread .github/workflows/tests.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

AA-Turner
AA-Turner reviewed Aug 3, 2024
View reviewed changes
Comment thread .github/workflows/tests.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

AA-Turner
AA-Turner reviewed Aug 3, 2024
View reviewed changes
Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

AA-Turner
AA-Turner reviewed Aug 3, 2024
View reviewed changes
Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner AA-Turner mentioned this pull request Aug 3, 2024
Initial support for reading mapping configuration as TOML python-babel/babel#1108
Merged
rffontenelle and others added 4 commits August 3, 2024 14:45
@rffontenelle @AA-Turner
Use python instead of python3 to run babel_runner.py
7878f4e
Co-authored-by: Adam Turner <[email protected]>
@rffontenelle
Replace os with pahlib in babe_runner.py
1fbd5d0
@rffontenelle
Add tomli import to support python<3.11
e3e08eb
@rffontenelle
CI test for minimum supported python version
a845398
@Wulian233

Wulian233 commented Sep 17, 2024

Copy link
Copy Markdown

It looks like this PR hasn't had a new activity in a while, is it finished now?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
Merge branch 'main' into add-localization
541c7a5
hugovk
hugovk reviewed Oct 26, 2024
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits, then I think we can merge this and iterate if needed, unless anyone else has any last comments?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/tests.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Wulian233

Wulian233 commented Oct 27, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

In the Simplified Chinese documentation, there is an issue regarding hard-coded (edit: not hard-coded) strings such as "added in version". that cannot be translated. Can this PR solve this problem?

python/python-docs-zh-cn#364

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rffontenelle

rffontenelle commented Oct 27, 2024

Copy link
Copy Markdown
Contributor Author

In the Simplified Chinese documentation, there is an issue regarding hard-coded strings such as "added in version" and "deprecated in version" etc. that cannot be translated. Can this PR solve this problem?

python/python-docs-zh-cn#364

No, that's a Sphinx string and it is not translated to zh_CN: https://github.com/sphinx-doc/sphinx/blob/116a430caca98580c8877cf7b0ba270eae9604bf/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po#L1951

Consider contributing in https://explore.transifex.com/sphinx-doc/sphinx-1/

Wulian233 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Wulian233 Wulian233 mentioned this pull request Oct 27, 2024
字段“Added in version”没有翻译 python/python-docs-zh-cn#364
Open
ezio-melotti
ezio-melotti reviewed Oct 28, 2024
View reviewed changes
Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread babel_runner.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

rffontenelle and others added 4 commits October 28, 2024 08:23
@rffontenelle @hugovk @ezio-melotti
Apply suggestions from code review
bd7c059
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
@rffontenelle
Remove possibly existing translation file
65a0360
Otherwise init command will be skipped
@rffontenelle
Add shell bash to success in Windows
69ab917
@rffontenelle
Swap init and extract to be didactic
2aa3a04
As one need to have POT before initializing PO
@rffontenelle

rffontenelle commented Oct 28, 2024

Copy link
Copy Markdown
Contributor Author

A few nits, then I think we can merge this and iterate if needed, unless anyone else has any last comments?

That's all from my side. Just a few minor changes.

hugovk reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rffontenelle rffontenelle mentioned this pull request Oct 28, 2024
Translations for the theme pradyunsg/furo#434
Open
hugovk
hugovk approved these changes Oct 28, 2024
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Wulian233

Wulian233 commented Oct 28, 2024

Copy link
Copy Markdown

It looks great! I have a question: where should we translate this theme, and how will the translation automatically sync to this repository?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rffontenelle

rffontenelle commented Oct 28, 2024

Copy link
Copy Markdown
Contributor Author

@Wulian233 I mentioned that in the issue and it is yet to be defined.

Some projects coordinate translation efforts in the own forge via pull/merge requests — not optimal for the translators. There is also translation platforms like Weblate, Transifex and others.

My vote would be to use Weblate, which provides "libre hosting" for free software and features automatic opening and updating pull request for contributed translations. Tasks involve: setting up Weblate project (I can help with/do it), maintainers here update POT and give time before releasing to receive translations; and merging translation pull requests from Weblate.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
hugovk merged commit 3c53d33 into python:main Oct 28, 2024
@rffontenelle
rffontenelle deleted the add-localization branch October 28, 2024 14:24
@rffontenelle rffontenelle mentioned this pull request Aug 8, 2025
Let's localize this theme #194
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AA-Turner AA-Turner AA-Turner left review comments
@ezio-melotti ezio-melotti ezio-melotti left review comments
@hugovk hugovk hugovk approved these changes
+1 more reviewer
@Wulian233 Wulian233 Wulian233 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@rffontenelle @Wulian233 @hugovk @AA-Turner @ezio-melotti
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.