FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: add Windows instructions for pomerge in translating guide by pranavchoudhary-tech · Pull Request #1862 · python/devguide · GitHub

docs: add Windows instructions for pomerge in translating guide - #1862

Open
pranavchoudhary-tech wants to merge 4 commits into
python:mainfrom
pranavchoudhary-tech:fix-windows-pomerge
Open

docs: add Windows instructions for pomerge in translating guide#1862
pranavchoudhary-tech wants to merge 4 commits into
python:mainfrom
pranavchoudhary-tech:fix-windows-pomerge

Conversation

pranavchoudhary-tech commented Jul 18, 2026
edited by zware
Loading

Copy link
Copy Markdown
Contributor

Fixes #1783

This PR adds the missing Windows commands tab for the pomerge translation recovery tool, resolving the TODO in translating.rst. The commands for Windows use xcopy and rmdir to achieve the same result as the Unix cp and rm.

read-the-docs-community Bot commented Jul 18, 2026
edited
Loading

Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor Author

Ah, my apologies! I created this branch from my fork's main branch without syncing with upstream/main first, which accidentally dragged in some unrelated commits from another PR I was working on.

I have just rebased and force-pushed to clean it up. It should only contain the Windows instructions for pomerge now. Let me know if everything looks good!

zware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The commands look reasonable to me, assuming that pomerge is available and working the same way on Windows.

I haven't tried this out, I'm hoping you have run this successfully? :)

Copy link
Copy Markdown
Contributor Author

Thanks for the review and approval! Yes, I can confirm the standard shell commands (xcopy, rmdir, git checkout) work perfectly in the Windows Command Prompt. Since pomerge is a Python tool, it uses Python's built-in glob which natively handles the **\*.po globbing patterns on Windows just as well as it does on Unix! 😄

Copy link
Copy Markdown
Member

@tomasr8 topic-sprints is for docs on how to organise/run sprints. I’ve just created a sprint label for PRs being worked on at a sprint, like in CPython.

StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can you please add the .. include:: /include/activate-tab.rst to the top of the file like we have elsewhere.

Copy link
Copy Markdown
Contributor Author

Done! Added the activate-tab.rst include to the top of the file.

tomasr8 commented Jul 18, 2026

Copy link
Copy Markdown
Member

@tomasr8 topic-sprints is for docs on how to organise/run sprints. I’ve just created a sprint label for PRs being worked on at a sprint, like in CPython.

Haha yeah I figured, sorry about that! I just wanted a temporary label so I could keep track of the issues :) Thanks for adding the label!

encukou commented Jul 18, 2026

Copy link
Copy Markdown
Member

I'll be at a Windows computer next week, if it helps.

pranavchoudhary-tech commented Jul 19, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

@StanFromIreland good catch from Claude! You're totally right, cmd.exe doesn't expand wildcards so the previous command would just crash.

I've updated the dosbatch instructions to use a standard for /R loop instead. This passes the files to pomerge one by one, which works perfectly since it saves its translation memory iteratively.

I also added shopt -s globstar to the Unix tab, since Bash actually needs that flag enabled for **/*.po to work recursively too. Thanks for pointing this out!

Copy link
Copy Markdown
Contributor Author

@StanFromIreland Excellent catch on the translation memory overwrite! You are absolutely right; pomerge overwrites ~/.pomerge.json on every invocation, so looping through files one-by-one is completely broken.

I've pushed a fix that replaces the Windows dosbatch tab entirely with a powershell script. By using PowerShell's Get-ChildItem, we can natively expand the wildcards into an array and pass all files to pomerge in a single invocation, bypassing the overwrite issue completely while avoiding the lack of native globbing in cmd.exe.

I've also applied your suggested comment to the Unix tab!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task: Add windows instructions for translations when CPython files move

5 participants


Back | FazBrowse Home | New Git URL