photo credit: abc via photopin (license)

Find translateable strings in Magento PHP Files

So here’s a nice little one-liner you can use to find strings that require translation in your Magento projects. Just go to the folder of your theme or extension and execute the following command:

What it does, it looks for occurances of __(‘ anything ‘)  in your code and creates a typical Magento CSV-translation string of it.
The output will be a copy/paste-able chunk of CSV data you can use as a boilerplate for your CSV-files:

… depending on what’s in your code of course …

Visitors give this article an average rating of 4.0 out of 5.

How would you rate this article?

Leave a Reply