Now that we have story and page created in install time via st(), their names and descriptions are nicely translated. But their field names (body and title) are not, because the called _node_type_set_defaults() expects to be called runtime, so it uses t() to retrieve the translated text. If we modify it to get the actual t function (either t() or st()) from the system, it is capable of creating the proper node type object in install time too.
Either we need to modify this function or we need to modify the install profile to include the Body and Title field names st()-ed. This is a patch to modify the function, which makes it easier to write localized profiles, since these does not need to be repeated.
This should get applied to Drupal 5.x-dev and 6.x-dev.
| Comment | File | Size | Author |
|---|---|---|---|
| Drupal.allow.field.name.t.patch | 994 bytes | gábor hojtsy |
Comments
Comment #1
dries commentedNot sure about this. Whatever you want to use in your install profiles, needs to be get_t()ed? IThis doesn't look like a solid solution. We're just fixing the problems we run into, not all problems we could potentially run into -- people can call any function from the install profiles.
Please don't mark your own patches at RTBC. Thanks.
Comment #2
gábor hojtsyWhatever you do in your install profiles can only be translated if it goes through st(). There is no other way. Abitrary Drupal functions are IMHO not to be called in install profiles, since Drupal is not bootstrapped and a proper environment is not in place.
get_t() might be a sympthom of some sickness here. When that function was introduced by Steven, it was deemed improper to add more logic into t() to check for install/runtime conditions. We can still wrap get_t() into t(), but this was voted down before.
Comment #3
dpearcefl commentedConsidering the age of this issue with no comments and that Drupal 5 is no longer supported, I'm closing this ticket.
Comment #4
dpearcefl commented