Open Source

I been playing with Open Source more and more because clients are demanding it.

I bump into yet another weird code structure.

in Magento
<?php echo $this->__(‘Help Us to Keep Magento Healthy’) ?> -

why not just put
<?php echo “Help Us Keep Magento Healthy”; ?>

Because usually when they do that, they’re using the object to localize the string. So to you it says it in english, but if $this 's localization is spanish… it’d be in spanish…

The Zend Framework does something similar… clicky

Underscore is a common alias for gettext or localization in general. PHP’s gettext extension for examples defines “_()” as an alias to “gettext()http://us.php.net/manual/en/function.gettext.php So when you do something like “_( 'Hello' )” if your localization is currently set to Japanese you will get the Japanese method/text of “Hello” instead of English.

ohhh very interesting. i’ll have to play with that.

is the language locale file included in the php library?