Skip to content

Skip empty message when writing mo file - #564

Merged
akx merged 2 commits into
python-babel:masterfrom
cedk:skip-empty-msgid
Aug 20, 2018
Merged

Skip empty message when writing mo file#564
akx merged 2 commits into
python-babel:masterfrom
cedk:skip-empty-msgid

Conversation

@cedk

@cedkcedk commented Mar 7, 2018

Copy link
Copy Markdown
Contributor

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

codecov-io commented Mar 7, 2018

Copy link
Copy Markdown

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 FilesCoverage Δ
babel/messages/mofile.py90.1% <100%> (-0.32%)⬇️
babel/_compat.py98.03% <0%> (-1.97%)⬇️
babel/messages/pofile.py96.19% <0%> (-0.66%)⬇️
babel/numbers.py97.67% <0%> (-0.34%)⬇️
babel/localtime/_unix.py23.28% <0%> (ø)⬆️
babel/messages/catalog.py94.69% <0%> (+0.06%)⬆️
babel/messages/frontend.py86.34% <0%> (+0.08%)⬆️
babel/util.py92.4% <0%> (+0.29%)⬆️
babel/plural.py96.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

akx commented Aug 19, 2018

Copy link
Copy Markdown
Member

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

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

@cedk

cedk commented Aug 19, 2018

Copy link
Copy Markdown
ContributorAuthor

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

akx commented Aug 20, 2018

Copy link
Copy Markdown
Member

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

Sign up for freeto 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.

3 participants

@cedk@codecov-io@akx