« Return to Thread: Use of variables in t()

Re: Use of variables in t()

by Derek Wright-2 :: Rate this Message:

Reply to Author | View in Thread


On Dec 23, 2008, at 6:53 PM, Hans Salvisberg wrote:

> Here's what I do to get potx to shut up:
>
> $tr = 't';
> $tr($foo)

Slick! ;)  Very clever, thanks!

> I forgot why I'm not using $t, but I think there was a reason...

Because potx still sees "$t($foo)" as if it's "t($foo)" and it gives  
the warning, anyway.  By using $tr($foo) it all works.

I guess it's a minor performance hit to do this, and it slightly  
obfuscates the code, so I doubt we can convince core to either  
implement or document this practice...

@Gabor: thoughts? ;)

Thanks,
-Derek (dww)



_______________________________________________
translations mailing list
translations@...
http://lists.drupal.org/mailman/listinfo/translations

 « Return to Thread: Use of variables in t()