[development] Why function t() arguments are not passed through t() again ?

Henrique Recidive recidive at gmail.com
Fri Jun 13 15:04:07 UTC 2008


2008/6/13 Juan Rodriguez <juan.fco.rodriguez at gmail.com>:
> Hello,
>
> I am trying to translate what comes from the following piece of code inside
> node.module:node_add()
> ....
>     drupal_set_title(t('Submit @name', array('@name' =>
> $types[$type]->name)));
> ....
> Using localization I can translate "Submit @name" to "Enviar @name".
> The problem is that the node type name is written in english and I can not
> change that name
> without breaking a lot of custom pages.

If you are running Drupal 5+, go to admin/content/types and change the
node type 'nice name' there.

> I wonder why the previous line is not written this way:
> ...
>     drupal_set_title(t('Submit @name', array('@name' =>
> t($types[$type]->name))));
> ...
> Another option would be to modify function t(), to automatically pass all
> arguments through
> t().
> Do you see any problem with modifiying t() ?
>
>


More information about the development mailing list