Looks like some clever module and theme authors add the empty string as translatable in their code. Localization server picks this up dutifully, but rather it should report it as a warning in the source code parse warnings. Maybe need to resolve on the potx layer.

Comments

gábor hojtsy’s picture

Title: Empty strings should not be stored » Empty source strings should not be stored
podarok’s picture

StatusFileSize
new156.9 KB

In UK L.D.O we have a lot of such strings too and they are marked as translated

subscribe

claudiu.cristea’s picture

Assigned: Unassigned » claudiu.cristea
Status: Active » Needs review
StatusFileSize
new968 bytes

Coming with a first patch...

Check the TODO that I added there...

gábor hojtsy’s picture

Status: Needs review » Needs work

@podarok: I think you might experience a different bug. Our bug here is that the SOURCE string is empty, while on your screenshot, none of the source strings are empty.

@claudiu.cristea: IMHO, first we should check in potx itself. I'd imagine we need to solve this in the "save string callback" functions, one of which is implemented in potx and another one is implemented in l10n_server. We should IMHO store an error for these strings as well, so the warning report will include these bogus sources.

podarok’s picture

2Gábor Hojtsy
gm... Oh, I see
In my screenshot there are many marked as translated strings but with empty or non visible translated strings...
Do I need creation for a new issue?

gábor hojtsy’s picture

@podarok: Yes, that IMHO should be a new issue.

gábor hojtsy’s picture

StatusFileSize
new3.05 KB

Opened a sister issue for potx at #609590: Do not store empty strings, signal an error instead which has the potx specific fixes. We need to use the same empty string treatment here, and I've added test coverage for that as well to ensure we have this right. Actually committing this, but don't know the exact time when I can roll this out (not now).

Best would be to also add an update function to convert empty source strings to warnings (since we know the file name and line info for them, we can easily generate these error messages on an update). And then remove these strings. That would help all kinds of sites running this module to update properly instead of just a one-off hackish rollout on localize.drupal.org.

Making needs work on that, but committed the attached patch, so even if this rolls out, such future modules will mark errors.

gábor hojtsy’s picture

Status: Needs work » Fixed

I've did manual update on deployment on drupal.org, did not add update function since this should not be a significant problem for other users most probably. Consider it done.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

hass’s picture

Isn't this not also an issue of potx? potx should not extract the empty string or poedit chokes

gábor hojtsy’s picture

@hass: read #7 up there please.