Skip to content

Commit

Permalink
Merge pull request #83 from mikelolasagasti/eu
Browse files Browse the repository at this point in the history
Add missing keys to extract translatable strings
  • Loading branch information
hugovk authored Feb 4, 2023
2 parents e9acce9 + dfe6681 commit a759dd9
Show file tree
Hide file tree
Showing 30 changed files with 2,060 additions and 1,900 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ FileNotFoundError: [Errno 2] No translation file found for domain: 'humanize'
How to add new phrases to existing locale files:

```sh
xgettext --from-code=UTF-8 -o humanize.pot -k'_' -k'N_' -k'P_:1c,2' -l python src/humanize/*.py # extract new phrases
xgettext --from-code=UTF-8 -o humanize.pot -k'_' -k'N_' -k'P_:1c,2' -k'NS_:1,2' -k'_ngettext:1,2' -l python src/humanize/*.py # extract new phrases
msgmerge -U src/humanize/locale/ru_RU/LC_MESSAGES/humanize.po humanize.pot # add them to locale files
```

Expand Down
6 changes: 3 additions & 3 deletions scripts/update-translations.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
set -e

# extract new phrases
/usr/local/opt/gettext/bin/xgettext --from-code=UTF-8 -o humanize.pot -k'_' -k'N_' -k'P_:1c,2' -k'NS_:1,2' -l python src/humanize/*.py
xgettext --from-code=UTF-8 -o humanize.pot -k'_' -k'N_' -k'P_:1c,2' -k'NS_:1,2' -k'_ngettext:1,2' -l python src/humanize/*.py

for d in src/humanize/locale/*/; do
locale="$(basename $d)"
echo "$locale"
# add them to locale files
/usr/local/opt/gettext/bin/msgmerge -U src/humanize/locale/$locale/LC_MESSAGES/humanize.po humanize.pot
msgmerge -U src/humanize/locale/$locale/LC_MESSAGES/humanize.po humanize.pot
# compile to binary .mo
/usr/local/opt/gettext/bin/msgfmt --check -o src/humanize/locale/$locale/LC_MESSAGES/humanize{.mo,.po}
msgfmt --check -o src/humanize/locale/$locale/LC_MESSAGES/humanize{.mo,.po}
done
Loading

0 comments on commit a759dd9

Please sign in to comment.