-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove generated translation binaries from repo #199
Conversation
Python 3.10-dev failures are due to GHA using some sort of 3.10 beta, but 3.10 isn't actually in beta yet, and pytest isn't quote yet ready for 3.10 beta:
Will ignore for now, should be resolved soon enough. |
Codecov Report
@@ Coverage Diff @@
## master #199 +/- ##
=======================================
Coverage 99.83% 99.83%
=======================================
Files 9 9
Lines 604 608 +4
=======================================
+ Hits 603 607 +4
Misses 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
echo "$locale" | ||
# compile to binary .mo | ||
msgfmt --check -o src/humanize/locale/$locale/LC_MESSAGES/humanize{.mo,.po} | ||
done |
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.
My only comment is that if msgfmt --check fails, for example if in the translation of the string "%d months" you forget the "%d", then this should stop and get fixed. You may need to check the exit code and act accordinly.
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.
Yes, good point. I checked it in another branch. A change like this:
diff --git a/src/humanize/locale/ca_ES/LC_MESSAGES/humanize.po b/src/humanize/locale/ca_ES/LC_MESSAGES/humanize.po
index 5e6a4f2..abdc464 100644
--- a/src/humanize/locale/ca_ES/LC_MESSAGES/humanize.po
+++ b/src/humanize/locale/ca_ES/LC_MESSAGES/humanize.po
@@ -221,8 +221,8 @@ msgstr "un mes"
#, python-format
msgid "%d month"
msgid_plural "%d months"
-msgstr[0] "%d mes"
-msgstr[1] "%d mesos"
+msgstr[0] "mes"
+msgstr[1] "mesos"
#: src/humanize/time.py:174
msgid "a year"
Fails on the CI like this:
Run scripts/generate-translation-binaries.sh
ca_ES
src/humanize/locale/ca_ES/LC_MESSAGES/humanize.po:224: number of format specifications in 'msgid_plural' and 'msgstr[0]' does not match
msgfmt: found 2 fatal errors
Error: Process completed with exit code 1.
https://github.com/hugovk/humanize/runs/2431670085?check_suite_focus=true
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.
This is great. Thanks!
Looks good to me. Thanks |
Fixes #198
Changes proposed in this pull request:
.mo
files from the repo and .gitignore them.mo
files if not found, the tester may not have gettext/msgfmt (like Windows CI).mo
files