throw new Exception(__('exception'));
What do the __'s do? What are they called? I've seen this in several implementations and is common throughout the Magento codebase.
Thanks
__
is a common name for a localization function. __
is a valid function name like any other.
function __($text) {
// return localized text
}
How exactly it works depends on the framework in question.
Usually if you see __()
or _()
its to pull the value of the string passed into the function from an i18n translation catalog. So the string passed to the function is looked up in the catalog and the appropriate translation is returned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With