Skip to content
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

Skip empty message when writing mo file #564

Merged
merged 2 commits into from
Aug 20, 2018

Conversation

cedk
Copy link
Contributor

@cedk cedk commented Mar 7, 2018

Instead of using the msgid, this allows to have gettext fallback to
retrieve the translation. Otherwise gettext will anyway return msgid.

Instead of using the msgid, this allows to have gettext fallback to
retrieve the translation. Otherwise gettext will anyway return msgid.
@codecov-io
Copy link

codecov-io commented Mar 7, 2018

Codecov Report

Merging #564 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #564      +/-   ##
==========================================
+ Coverage   90.23%   90.31%   +0.07%     
==========================================
  Files          24       24              
  Lines        4045     4128      +83     
==========================================
+ Hits         3650     3728      +78     
- Misses        395      400       +5
Impacted Files Coverage Δ
babel/messages/mofile.py 90.1% <100%> (-0.32%) ⬇️
babel/_compat.py 98.03% <0%> (-1.97%) ⬇️
babel/messages/pofile.py 96.19% <0%> (-0.66%) ⬇️
babel/numbers.py 97.67% <0%> (-0.34%) ⬇️
babel/localtime/_unix.py 23.28% <0%> (ø) ⬆️
babel/messages/catalog.py 94.69% <0%> (+0.06%) ⬆️
babel/messages/frontend.py 86.34% <0%> (+0.08%) ⬆️
babel/util.py 92.4% <0%> (+0.29%) ⬆️
babel/plural.py 96.04% <0%> (+0.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1378a3d...85f6587. Read the comment docs.

@akx
Copy link
Member

akx commented Aug 19, 2018

Is this the behavior of the GNU gettext .mo utilities too?

I'd like to see a test added, anyway. :)

@cedk
Copy link
Contributor Author

cedk commented Aug 19, 2018

I added a test.
Here is the place where msgfmt from GNU Gettext does the same: https://github.com/autotools-mirror/gettext/blob/master/gettext-tools/src/msgfmt.c#L1296

@akx
Copy link
Member

akx commented Aug 20, 2018

Thank you for the test and the verification! (And thanks for the code too, of course.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants