In some additional module, l10n extracts empty strings. I think that potx extracts bad t() strings like t($variable) or similar ones. I will investigate about this bug...

Comments

psicomante’s picture

I missed to say that this bug breaks some file translation.

general.it.po

#: abuse.module:0,0; watchlist/watchlist.module:0,0
msgid ""
msgstr " "

#: abuse.info:0,0; watchlist/watchlist.info:0,0
msgid "Administration"
msgstr "Amministrazione"
gábor hojtsy’s picture

Hm, strings recorded being on the 0.th line are:

- javascript strings, but this does not seem to be applicable here (would need a .js extension)
- .info files strings (again, would need .info extension)
- the file name itself (this is suspicious, but reused so many times in potx, that I don't think that this is the problem)
- special stuff, such as date formats, but only for common.inc which is again not a case here

I also looked into abuse.module and there are indeed very bad t() usage in this module, such as t('Warn and '. ucfirst($op)). Although none of these should cause empty strings to be recorded, or least not under normal operation.

Also downloaded the HEAD code of abuse.module, run the potx-cli.php script on it, and cannot reproduce the empty string.

Seems like we need more information.

gábor hojtsy’s picture

BTW just as I closed my abuse.module CVS window, I realized it has a custom permission "handling system" (ie. uses constants instead of literal strings for permission names). But looking at the potx implementation, this should not be a problem. What is the exact version of the abuse.moduel causing these problems?

gábor hojtsy’s picture

BTW I just committed an error condition report to the 6.x-2-dev version of potx which throws an error for such hook_perm() implementations (will probably backport to Drupal 5 later, see http://hojtsy.hu/blog/2007-nov-15/make-jump-ensure-your-drupal-modules-a...). Although I clearly believe that this should not cause empty strings appearing in the .pot.

psicomante’s picture

Ok, i installed a l10n_server on a clean drupal installation.
I downloaded l10n_server (the last version, updated today), and potx (updated yesterday). I used the local_community module.

I downloaded abuse-5.x-dev.tar.gz. Put it in files folder. Scanned.

Strings: 100.
Empty Strings: 0.

I imported the italian translation => Empty strings: 0. It seems i can't reproduce anymore that bug!

psicomante’s picture

Local Test: OK
Modules used: l10n_community, l10n_localepackages, potx
Module parsed: abuse-5.x-dev.
Strings Extracted: 100.

PHP: 5.2.2
MySQL: 5.0.41
Server: Apache/2.2.4 (Ubuntu) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.2
ModRewrite: Enabled

===========

Online (Hoster) Test: NOK (It misses some strings)
Modules used: l10n_community, l10n_localepackages, potx
Module parsed: abuse-5.x-dev.
Strings Extracted: 98

PHP: 5.1.2
MySQL: 5.0.38
Server: Apache/2.0.55 (Ubuntu) DAV/2 SVN/1.3.1 mod_ssl/2.0.55 OpenSSL/0.9.8a mod_perl/2.0.2 Perl/v5.8.7

The two not translated in "online" server are

Local server:

abuse-module.pot

#: abuse.module:0
msgid "abuse"
msgstr ""

wathlist-module.pot

#: watchlist.module:0
msgid "watchlist"
msgstr ""

Online server:

Those strings don't exist. L10n_server adds too an empty string, not extracted and misse a string from watchlist.module.

Both placed at bottom of po/pot files.
Same issue on admin-message project.

gábor hojtsy’s picture

OK, so this is due to the import misbehaving. That's news :) I'll look into this later.

psicomante’s picture

i was wrong Gàbor, i had been edited the message (i hope this is meaningful!!). I thought that the problem was in importing translations, but i was in error.

gábor hojtsy’s picture

Psicomante: could you please post follow ups instead of modifying what I got in the mail / I already answered... Duh.

L10n_server adds too an empty string, not extracted and misse a string from watchlist.module.

How does this empty string look in the database? How is this "not extracted"? What string is "misse"?

psicomante’s picture

Sorry Gàbor.

INSERT INTO `l10n_community_string` (`sid`, `value`) VALUES
(1, 'Close'),
(2, 'Close this message'),
(3, 'Message visibility'),
(4, 'Show message (sticky)'),
(5, 'Always show this message to new users'),
(6, 'Show if the following PHP code returns ................ (PHP-mode, experts only)'),
(7, 'Enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.'),
(8, ''),
INSERT INTO `l10n_community_line` (`fid`, `lineno`, `sid`) VALUES
(1, 136, 1),
(1, 136, 2),
(1, 147, 3),
(1, 155, 4),
(1, 160, 5),
(1, 171, 6),
(1, 172, 7),
(1, 0, 8),
INSERT INTO `l10n_community_file` (`fid`, `rid`, `location`, `revision`) VALUES
(1, 1, 'admin_message/admin_message.module', 'admin_message.module,v 1.1.2.2 2007/07/27 07:26:56 fajerstarter'),
(2, 1, 'admin_message/admin_message.install', 'admin_message.install,v 1.1.2.1 2007/07/26 17:27:33 fajerstarter'),
(3, 1, 'admin_message/admin_message.info', 'admin_message.info,v 1.1 2007/07/21 12:38:29 fajerstarter'),
(4, 1, 'admin_message/admin_message.js', 'admin_message.js,v 1.1 2007/07/21 12:38:29 fajerstarter'),
(5, 1, 'admin_message/admin_message_form.js', 'admin_message_form.js,v 1.1.2.1 2007/08/04 19:44:53 fajerstarter'),
(6, 2, 'abuse/abuse.module', 'abuse.module,v 1.18 2007/04/24 19:55:09 btmash'),
(7, 2, 'abuse/abuse.install', 'abuse.install,v 1.4 2007/03/30 17:38:06 btmash'),
(8, 2, 'abuse/abuse.info', 'abuse.info,v 1.4 2007/06/18 23:50:47 dww'),
(9, 2, 'abuse/watchlist/watchlist.module', 'watchlist.module,v 1.4 2007/04/11 15:55:33 btmash'),
(10, 2, 'abuse/watchlist/watchlist.info', 'watchlist.info,v 1.3 2007/06/18 23:50:47 dww');
INSERT INTO `l10n_community_error` (`eid`, `rid`, `value`) VALUES
(1, 2, 'Invalid marker content in <em>abuse/abuse.module</em>:<em>245</em>\n* <em>t</em>(<em>$reason-&gt;reason)</em>\n\n'),
(2, 2, 'Invalid marker content in <em>abuse/abuse.module</em>:<em>252</em>\n* <em>t</em>(<em>$reason-&gt;description)</em>\n\n'),
(3, 2, 'Invalid marker content in <em>abuse/abuse.module</em>:<em>256</em>\n* <em>t</em>(<em>$reason-&gt;argumentation)</em>\n\n'),
(4, 2, 'Invalid marker content in <em>abuse/abuse.module</em>:<em>514</em>\n* <em>t</em>(<em>$reason-&gt;reason)</em>\n\n'),
(5, 2, 'Invalid marker content in <em>abuse/abuse.module</em>:<em>687</em>\n* <em>t</em>(<em>variable_get(&#039;abuse_warn_subject&#039;,&#039;&#039;))</em>\n\n'),
(6, 2, 'Invalid marker content in <em>abuse/abuse.module</em>:<em>695</em>\n* <em>t</em>(<em>variable_get(&#039;abuse_warn_body&#039;,&#039;&#039;))</em>\n\n'),
(7, 2, 'Invalid marker content in <em>abuse/abuse.module</em>:<em>702</em>\n* <em>t</em>(<em>&#039;Warn and &#039;.ucfirst($op))</em>\n\n');
gábor hojtsy’s picture

From the l10n_community_line data, it shows that sid 8 is recorded from fid (file) 1 on line 0. File 1 is (1, 1, 'admin_message/admin_message.module', 'admin_message.module,v 1.1.2.2 2007/07/27 07:26:56 fajerstarter'), which is code: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/admin_messa... I looked though this, but have no idea what might cause that empty string. Is still still happening in latest l10n_server?

hass’s picture

http://drupal.org/node/231444 could be a duplicate of this... :-(

meba’s picture

Can you please check with 6.x-dev version of l10n_server?

gábor hojtsy’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)