How can I check if $this->__("something") returned a translated version or not?
2 Answers
In the app\locale\en_GB
add a csv file Mage_Catalog.csv
or whichever area you are translating.
Then write like "something","something else"
within that csv file.
After that select the language for that very store to be English Britain(United Kingdom) from the multi select option from admin System > Config area. Your site should see the UK English then and this very word will be shown "something else" for UK and "something" for the US or the default locale whichever it is. By default Magento only has en_US inside locale, so that rest you will to add within en_GB Directory.
As to begin you can use the following link --
-
but I want to know in the template if $this->__("something") will be translated or not– glafcheCommented Sep 13, 2018 at 13:47
It will be translated if the string translation for "something" exist in one of these location (ordered by priority):
- in
core_translate
table - in theme
translate.csv
file - in the module translation file of the containing block, example.
app\locale\{en_US}\Mage_Catalog.csv
. The path{en_US}
depends on what language selected in current store.
You can see the translated string by accessing the said page from your browser.