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

Filter out empty msgid entries #64

Closed
mgeisler opened this issue Aug 27, 2023 · 0 comments · Fixed by #111
Closed

Filter out empty msgid entries #64

mgeisler opened this issue Aug 27, 2023 · 0 comments · Fixed by #111
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mgeisler
Copy link
Collaborator

I tried running mdbook-xgettext on the Rust Book. After removing formatting from the SUMMARY.md file, I end up with a messages.pot file which is almost correct:

% msgcat -o po/messages.pot po/messages.pot
po/messages.pot:1660: duplicate message definition...
po/messages.pot:3: ...this is the location of the first definition
msgcat: found 1 fatal error

The problem is this entry:

#: src/appendix-04-useful-development-tools.md:120
#: src/appendix-04-useful-development-tools.md:149
msgid ""
msgstr ""

which in turn originates from a non-empty HTML tag:

<span class="filename">Filename: src/main.rs</span>

The empty msgid is also produced by empty HTML tags:

<span id="ferris"></span>

We should handle such entries correctly. This would mean

  1. Ensure we don't add duplicate entries to the PO file. This is perhaps something that need fixing in polib.
  2. Perhaps we should extract the text inside inline HTML tags such as the span above?
@mgeisler mgeisler added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Aug 27, 2023
mgeisler added a commit that referenced this issue Nov 5, 2023
This skips empty messages and messages consisting of whitespace only.

Fixes #64.
@mgeisler mgeisler self-assigned this Nov 5, 2023
mgeisler added a commit that referenced this issue Nov 8, 2023
This skips empty messages and messages consisting of whitespace only.

Fixes #64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant