NYCPHP Meetup

NYPHP.org

[nycphp-talk] gettext help

David Krings ramons at gmx.net
Sat Dec 15 22:21:17 EST 2007


David Krings wrote:
> Hi!
> 
> function and a short array name will condense the calls. It is not as  
> short as _(), well, I could name my function _, but I don't think that 
> is a good idea. Maybe ~() or €() isn't taken yet. The other disadvantage 

I found that PHP doesn't like ~ as a function name, but € is fine. After 
reading in the ini file or a portion of it I can now craft echos as such
echo €(123456, $l, "This is the default string.");
with the integer being the numeric key (alphanumeric would work as well, but 
with alphas in the key spellchecking the ini string file is a pita), $l the 
array that contains the string for the current script, and the optional string 
being a default text if the requested string is not found.
I may get back to it and refine the € function to pass things like a number or 
a date along that then needs to be inserted into the correct position, but I 
will see if I need this for my app. If anyone is interested in the functions 
let me know and I'll post them.

So long, gettext, maybe next time....


David




More information about the talk mailing list