Empty source strings should not be stored

Gábor Hojtsy - September 19, 2009 - 09:35
Project:Localization server
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:claudiu.cristea
Status:closed
Description

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.

AttachmentSize
Empty t.png94.7 KB

#1

Gábor Hojtsy - September 30, 2009 - 12:21
Title:Empty strings should not be stored» Empty source strings should not be stored

#2

podarok - October 17, 2009 - 08:49

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

subscribe

AttachmentSize
empty.jpg 156.9 KB

#3

claudiu.cristea - October 17, 2009 - 10:28
Assigned to:Anonymous» claudiu.cristea
Status:active» needs review

Coming with a first patch...

Check the TODO that I added there...

AttachmentSize
l10n_server_empty_source_strings-D6.patch 968 bytes

#4

Gábor Hojtsy - October 19, 2009 - 06:51
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.

#5

podarok - October 19, 2009 - 09:18

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?

#6

Gábor Hojtsy - October 19, 2009 - 09:23

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

#7

Gábor Hojtsy - October 20, 2009 - 15:56

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.

AttachmentSize
empty-string-with-tests.patch 3.05 KB

#8

Gábor Hojtsy - November 17, 2009 - 23:18
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.

#9

System Message - December 1, 2009 - 23:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.