db strings extract script needs to skip empty strings



3 years ago
3 years ago


(Reporter: mathjazz, Assigned: willkg)


Firefox Tracking Flags

(Not tracked)




3 years ago
Empty strings are not allowed in Gettext:

Their representation in locale files (and consequently in Pontoon, Verbatim , poEdit and all other tolls) is weird - empty string is shown as original and the PO file header as translation (LOL?).

Check it out in SVN:

But that's actually what the spec says:
"This also has another advantage, as the empty string in a PO file GNU gettext is usually translated into some system information attached to that particular MO file, and the empty string necessarily becomes the first in both the original and translated tables, making the system information very easy to find."

This is coming from the db strings extract script. It should be skipping empty strings. I adjusted the title accordingly. This is an easy fix, so if no one gets to it today, I'll do it.
Summary: Empty strings not allowed in Gettext → db strings extract script needs to skip empty strings
Further, this is a problem with Input, too. I'll write up a bug for that later.
Grabbing this to do now.
Assignee: nobody → willkg
I tweaked the extract_db.py script. However, there's nothing in the db that creates an empty string and I spent some time looking back in time and I don't know where those strings came from. That fuzzy block should get removed.

In a PR: https://github.com/mozilla/kitsune/pull/2749
That PR landed in master: https://github.com/mozilla/kitsune/commit/e2da7b3c4dec28b69dcc70cc0ccd697501525b68

After Mike traced down the strings, we think what happened was we did a db strings extraction with an empty db. I added a "Are you sure...?" kind of prompt to the command.

PR and some discussion about how to do that better in: https://github.com/mozilla/kitsune/pull/2752
After some discussion, I nixed PR 2752.

I think the only outstanding thing here is to re-extract the strings. I don't know if we need to additionally go through all the .po files and clean them up.

matjaz: Do we need to go through and clean up the .po files or do you think the natural flow of the universe will sort it out?
Flags: needinfo?(m)

Comment 7

3 years ago
I suspect re-extract means the problematic string will be gone for all locales:

So that should be enough.

If it doesn't mean that it's gone, we need to find another way to make it gone. ;)
Flags: needinfo?(m)
I think the issues are fixed now. I'm going to mark this FIXED. If there are still outstanding issues, someone can reopen it so we can investigate.
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.