0

I have a recollection of seeing a tool or script that could analyse a legacy Magento project (custom theme and modules) to check for non-i18n code.

The concept of a regex to find strings that are not double-underscore wrapped __('abc') crosses my mind but seems likely to get a lot of false positives.

Any other suggestions?

2 Answers 2

3

I've developed an extension that you can use to collect the texts that should be translated from a magento module (or a set of modules). It is based on the same regex used by the tool that @Fooman talkes about in his answer.
It also let's you identify texts from a locale that are not translated (key = value) but for this false positives may occur.
The extension is free, give it a try. I've used it on my other custom modules and it seams to work.

1

Magento once had a download in their Enterprise section called 'translation-tools' which gives you a bunch of scripts to create translation csv files. Maybe this is what you are recollecting?

The code uses regexes to find __('abc') but does not perform the reverse (finding strings that are not run through Magento's translations).

I would currently have to agree with the assessment that you would get a lot of false positives when trying to find this programmatically since you are parsing xml, html, php, javascript and potentially some sql for good measure.

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.