Closed (fixed)
Project:
Hall of Fame
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 May 2005 at 16:36 UTC
Updated:
22 May 2005 at 20:59 UTC
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
Comment #1
syscrusher commentedThe 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
Comment #2
Cvbge commentedI'm not an expert myself, I don't know what's the correct way...
I think this won't help in any way so it's better not to do this.
variable_get() in this case retrives user-supplied value, so there is nothing that can be done, IMO.
What constant?
As for $interval, it's already t()'ed, isn't it?
Comment #3
syscrusher commentedI 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.
Yes, it is.
Scott
Comment #4
syscrusher commentedI'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
Comment #5
Cvbge commentedextractor.php does not complains anymore with new version, thanks for your fix :)
Comment #6
syscrusher commentedComment #7
(not verified) commented