0

I am trying to translate a module for a few languages. I don't want to use inline translations because every person which is using module will have to change translations in theirs database, so I found method where I can create translation.csv file and put it in my extension package.

I want to translate labels in admin configuration panel, and after lecture of a few articles about translations, I've added this code inside tag in config.xml:

<translate>
    <modules>
        <SalesManago_Tracking>
            <files>
                <default>SalesManago_Tracking.csv</default>
            </files>
        </SalesManago_Tracking>
    </modules>
</translate>

And then I created SalesManago_Tracking.csv files in two places: app/design/adminhtml/default/default/locale/fr_FR/ (for example) app/locale/fr_FR/

After that I've added translation for one of labels:

<api_secret translate="label">
       <label>Api secret</label>
       <frontend_type>text</frontend_type>
       <sort_order>20</sort_order>
       <show_in_default>1</show_in_default>
       <show_in_website>1</show_in_website>
      <show_in_store>1</show_in_store>
</api_secret>

So I've put a line in my csv file:"Api secret","Check translations!"

Looks ok, but when I change locale to France it doesn't work... Can someone please tell me, what am I doing wrong ? Thx! (I turned off every of caches )

1 Answer 1

0

Make sure ...

  • your config node is not a child of <frontend> but of <adminhtml>.
  • you set your backend locale to the language in question (dropdown at the bottom).
  • really ALL caches are disabled including configuration cache.

The following setup worked for me - the option apparently shows under "Checkout" configuration for testing purposes:

app/code/local/SalesManago/Tracking/etc/config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <SalesManago_Tracking>
            <version>1.0.0</version>
        </SalesManago_Tracking>
    </modules>
    <adminhtml>
        <translate>
            <modules>
                <SalesManago_Tracking>
                    <files>
                        <default>SalesManago_Tracking.csv</default>
                    </files>
                </SalesManago_Tracking>
            </modules>
        </translate>
    </adminhtml>
</config>

app/code/local/SalesManago/Tracking/etc/system.xml

<?xml version="1.0"?>
<config>
    <sections>
        <checkout>
            <groups>
                <options>
                    <fields>
                        <api_secret translate="label">
                            <label>Api secret</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>20</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </api_secret>
                    </fields>
                </options>
            </groups>
        </checkout>
    </sections>
</config>

app/locale/fr_FR/SalesManago_Tracking.csv

"Api secret","TEST"
3
  • It is a child of <adminhtml>, do you have any other idea ?
    – P. Grzanka
    Nov 8, 2016 at 7:49
  • Ok it's my mistake... Case sensitive... I'va called my files Salesmanago_tracking but I should SalesManago...
    – P. Grzanka
    Nov 8, 2016 at 11:59
  • Or you could switch to a case-insensitive filesystem ;)
    – pong
    Nov 8, 2016 at 12:31

Your Answer

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

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