0

I am creating a simple module that displays a date.
I need the days (Monday, Tuesday, etc.) to be translated in the store view language.

I've gotten lost in all the different ways that this could be done:

1) Where should I create the .csv file? (preferably in my module, if that's at all possible)

2) How would I tell Magento which words to translate? I'm currently using the indexcontroller.php to display the date (In case that changes something).

Can someone guide me through this or suggest a tutorial that I might have missed?

1 Answer 1

1

Follow this step-by-step:

1 - On your module on the file called config.xml set the csv file to translate:

<frontend>
    <translate>
        <modules>
            <modulename>
                <files>
                    <default>Package_Modulename.csv</default>
                </files>
            </modulename>
        </modules>
    </translate>
</frontend>
<admin>
<translate>
    <modules>
        <modulename>
            <files>
                <default>Package_Modulename.csv</default>
            </files>
        </modulename>
    </modules>
</translate>
</admin>

2 - Create your file, for example:

app/local/en_US/Package_Modulename.csv

3 - Apply on code like these samples:

$this->__('My Extension')

or

Mage::helper("myhelper")->__('My Extension')

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.