0

For some languages (en_UK, fi_FI and others) there are outdated language packs available on Magento connect (in these cases based on Magento 1.6).

We are using a recent Enterprise Edition (1.13).

Basically we want to generate a new CSV files which contains all the texts of our current Magento version (i.e. from the en_US folder of Magento Core) and pre-fill / merge the already existing translations (from the outdated non-US-English language pack), so that a translator can fill the missing fields.

Are there tools for that / did anybody do this before?

Remark: I did some edits for clarification in the text, so old comments might not apply anymore.

6
  • I have the same problem with pl_PL. It would be a nice idea for a hackathon, in case there is no solution out there.
    – fmrng
    Commented Aug 28, 2013 at 9:52
  • We built something which might help: github.com/magento-hackathon/Hackathon_LocaleFallback Commented Aug 28, 2013 at 9:57
  • @FabianBlechschmidt: I saw this project a while ago, but did not understand it because of poor README.md :-P
    – Alex
    Commented Aug 28, 2013 at 10:33
  • @FabianBlechschmidt: Is the idea to use editor tools which are made for .po files for Magento?
    – Alex
    Commented Aug 28, 2013 at 10:34
  • 1
    The idea is, that you can have a fallback language. The usecase was: you have de_DE and de_CH, nearly everything is the same but a few are not, so if you don't find a phrase in de_CH look it up in the fallback, de_DE... Commented Aug 28, 2013 at 10:46

1 Answer 1

1

This is not a solution. It's more of an idea. You can identify the texts that are 'translatable' with a regex. See the answers here, then just parse the existing CSV files (that should be easy) and merge the results.
If you use this regex '/helper\(\\\'([a-z_]+)\\\'\)-\>__\([\s]*([\'|\\\"])(.*?[^\\\\])\\2.*?\)/' it should identify the module names in texts like Mage::helper('some_helper')->__('Some text').
The hard part in identifying the module is for texts like $this->__('Some text') but you should be able to get the module from the file path. Use this regex for that '/\$this-\>__\([\s]*([\'|\\\"])(.*?[^\\\\])\\1.*?\)/'.
For xml files it should be easy. Just parse them and look for the translate attribute.

4
  • In addition...some time ago there was a tool for identifying translatable texts that you could download from the EE account. It used the exact same regular expressions, but it's gone now. WHY MAGENTO TEAM...WHY?
    – Marius
    Commented Aug 28, 2013 at 11:22
  • Updated my question...
    – Alex
    Commented Aug 28, 2013 at 12:21
  • @Alex Ok. My answer still sounds valid to me. Unless I'm missing something. If so, please ignore me. tell me and I will delete the answer to avoid "background noise"
    – Marius
    Commented Aug 28, 2013 at 12:34
  • :) Will think about it more. But to find the texts from the code base, I think there is even some Magento tool...
    – Alex
    Commented Aug 28, 2013 at 16:36

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.