0

How can I check if $this->__("something") returned a translated version or not?

2 Answers 2

0

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 --

https://www.cloudways.com/blog/magento-multi-language/

1
  • but I want to know in the template if $this->__("something") will be translated or not
    – glafche
    Commented Sep 13, 2018 at 13:47
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.