While running extractor.php on hof.module I get following errors:

Invalid marker content in hof.module:316
* t(variable_get('hof_promoted_label','Promoted Nodes'))
Invalid marker content in hof.module:317
* t(variable_get('hof_node_label','nodes'))
Invalid marker content in hof.module:324
* t($interval)
Invalid marker content in hof.module:337
* t($interval)

This also happens for 4.6 version.

Comments

syscrusher’s picture

Assigned: Unassigned » syscrusher

The code in HOF should be accepted, I would think. It calls an inner function to retrieve a variable, with a default value being supplied. The result of that call yields an English-language string which is then passed to t() for translation. Is this possibly a bug (or design limitation) in extractor.php itself, not being able to handle the nested function calls?

I can probably make the error go away by assigning an intermediate variable as the result of the variable_get() call, but it would seem that t() should accept a non-constant as its parameter. There is certainly nothing in the documentation of t() that suggests this would not be the case.

I looked at the code that initializes the cache for variable_get(), and there's no translation at that level, so I need this t() call.

I've not worked with extractor.php before, so if I'm overlooking something, please let me know. I'll be happy to insert the intermediate variables in the code if needed, but I don't think this will let extractor.php find the string constants anyway, so I'm not sure it helps much.

Suggestions welcome.

Scott

Cvbge’s picture

I'm not an expert myself, I don't know what's the correct way...

I can probably make the error go away by assigning an intermediate variable as the result of the variable_get() call, but it

I think this won't help in any way so it's better not to do this.

I looked at the code that initializes the cache for variable_get(), and there's no translation at that level, so I need this t() call.

variable_get() in this case retrives user-supplied value, so there is nothing that can be done, IMO.

I've not worked with extractor.php before, so if I'm overlooking something, please let me know. I'll be happy to insert the intermediate variables in the code if needed, but I don't think this will let extractor.php find the string constants anyway, so I'm not sure it helps much.

What constant?

As for $interval, it's already t()'ed, isn't it?

syscrusher’s picture

What constant?

I mean, the string constant that is the default value for variable_get(). Hmmmm... Maybe what I need to do is to t() the constant being passed to variable_get() instead of the result coming out of it. Let's try that.

As for $interval, it's already t()'ed, isn't it?

Yes, it is.

Scott

syscrusher’s picture

I'm pretty sure the new versions just committed to CVS (HEAD, DRUPAL-4-5, and DRUPAL-4-6 branches) will fix this issue. Please let me know so I can either close this issue or revisit the problem.

Scott

Cvbge’s picture

extractor.php does not complains anymore with new version, thanks for your fix :)

syscrusher’s picture

Anonymous’s picture