From fc0c61654d87a1c8e9681d037a9850e3aa7d5b9f Mon Sep 17 00:00:00 2001 From: pranavchoudhary-tech Date: Sat, 18 Jul 2026 08:59:23 +0530 Subject: [PATCH 1/3] docs: add Windows instructions for pomerge in translating guide --- documentation/translations/translating.rst | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/documentation/translations/translating.rst b/documentation/translations/translating.rst index e75ccb93c..e313dc2fc 100644 --- a/documentation/translations/translating.rst +++ b/documentation/translations/translating.rst @@ -393,8 +393,6 @@ messages, regardless of file paths. To use it, first install the package: Then, merge translations from a specific commit (replace :samp:`{COMMIT_HASH}` with the commit hash from before the files were moved): -.. TODO: Provide Windows instructions. - .. tab:: Unix .. code-block:: bash @@ -416,6 +414,27 @@ with the commit hash from before the files were moved): # Clean up temporary dir rm -rf /tmp/old-po-files +.. tab:: Windows + + .. code-block:: dosbatch + + rem These commands are to be run in the root of the translation repo + + rem Check out a commit before the move + git checkout COMMIT_HASH -- . + + rem Copy translations to a temporary dir + xcopy . %TEMP%\old-po-files\ /E /I /Q /Y + + rem Return to the current version + git checkout HEAD -- . + + rem Merge translations from temporary dir back in + pomerge --from "%TEMP%\old-po-files\**\*.po" --to "**\*.po" --clear + + rem Clean up temporary dir + rmdir /S /Q %TEMP%\old-po-files + After running ``pomerge``, review the changes and commit the updated files. You may also need to rewrap the lines (see :pypi:`powrap`). From 01ee673c57c6e4529998c2a7ffb7704e40f4e914 Mon Sep 17 00:00:00 2001 From: pranavchoudhary-tech Date: Sat, 18 Jul 2026 22:16:14 +0530 Subject: [PATCH 2/3] docs: add activate-tab include to translating guide --- documentation/translations/translating.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/translations/translating.rst b/documentation/translations/translating.rst index e313dc2fc..a1f4c6a8d 100644 --- a/documentation/translations/translating.rst +++ b/documentation/translations/translating.rst @@ -4,6 +4,8 @@ Translating =========== +.. include:: /include/activate-tab.rst + .. highlight:: rest There are several documentation translations already From 6a852871af40fa5434cd8a38f4ee4707b802d25d Mon Sep 17 00:00:00 2001 From: pranavchoudhary-tech Date: Sun, 19 Jul 2026 08:10:13 +0530 Subject: [PATCH 3/3] docs: fix globbing commands for pomerge on Windows and Unix --- documentation/translations/translating.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/documentation/translations/translating.rst b/documentation/translations/translating.rst index a1f4c6a8d..f651c11e3 100644 --- a/documentation/translations/translating.rst +++ b/documentation/translations/translating.rst @@ -411,6 +411,7 @@ with the commit hash from before the files were moved): git checkout HEAD -- . # Merge translations from temporary dir back in + shopt -s globstar pomerge --from /tmp/old-po-files/**/*.po --to **/*.po --clear # Clean up temporary dir @@ -431,11 +432,17 @@ with the commit hash from before the files were moved): rem Return to the current version git checkout HEAD -- . - rem Merge translations from temporary dir back in - pomerge --from "%TEMP%\old-po-files\**\*.po" --to "**\*.po" --clear + rem Learn translations from temporary dir + for /R "%TEMP%\old-po-files" %F in (*.po) do pomerge --from "%F" + + rem Apply translations to current files + for /R . %F in (*.po) do pomerge --to "%F" + + rem Clean up translation memory + pomerge --clear rem Clean up temporary dir - rmdir /S /Q %TEMP%\old-po-files + rmdir /S /Q "%TEMP%\old-po-files" After running ``pomerge``, review the changes and commit the updated files. You may also need to rewrap the lines (see :pypi:`powrap`).