Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9d3ab5

Browse files
committed
Document how I merged pot files.
1 parent dcd20ad commit c9d3ab5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,27 @@ Find fuzzy strings:
175175
.. code-block:: bash
176176
177177
grep -c fuzzy **/*.po | grep -v ':1$\|:0$'
178+
179+
180+
Merge pot files from cpython doc:
181+
182+
.. code-block:: bash
183+
184+
VERSION=3.6
185+
git clone --depth 1 --branch $VERSION https://github.com/python/cpython.git /tmp/cpython/
186+
(cd /tmp/cpython/ && sphinx-build -Q -b gettext -D gettext_compact=0 Doc pot/)
187+
POT_PATH="/tmp/cpython/pot/"
188+
PO_PATH="./"
189+
190+
find "$POT_PATH" -name '*.pot' |
191+
while read -r POT
192+
do
193+
PO="$PO_PATH/$(echo "$POT" | sed "s#$POT_PATH##; s#\.pot\$#.po#")"
194+
mkdir -p "$(dirname "$PO")"
195+
if [ -f "$PO" ]
196+
then
197+
msgmerge --backup=off --force-po -U "$PO" "$POT"
198+
else
199+
msgcat -o "$PO" "$POT"
200+
fi
201+
done

0 commit comments

Comments
 (0)