OpenCart – Translate Module to Native Language

Q: How do I translate a module to my language?
How can I translate to my language?
Why does this mod show in English when my site is in another language?

Answer:
OpenCart uses a language fallback to English by default. If you are using a 3rd party extension that was coded for English or some other language that doesn’t have a translation to your language, it will show up in English while the rest of your site is in your custom language. If you want to add support for your language, you will simply need to make a copy of the language file and put it into your language folder. You can simply follow these steps.
This assumes you already have the language pack for your language for the rest of opencart.

1. First locate the language file that comes with the mod. There are almost always 2 files, one admin, one catalog. Let’s assume they are English and are for a 3rd party module. The language files should be found at:
a. admin/language/english/module/module_name.php
b. catalog/language/english/module/module_name.php

2. Copy the first file from:
admin/language/english/module/module_name.php
and paste into:
admin/language/<yourlang>/module/module_name.php

3. Copy the second file from:
catalog/language/english/module/module_name.php
and paste into:
catalog/language/<yourlang>/module/module_name.php

4. Edit the first file. In the file you will see something like:

<?php
// Heading
$_['heading_title']   = 'My Mod';

// Button
$_['button_submit']  = 'Submit';

// Text
$_['text_product']    = 'Product';
$_['text_category']  = 'Category';
?>

You will need to translate the right-side only of the file.
For example, if we were to translate this to Spanish it would become:

    <?php
    // Heading
    $_['heading_title']    = 'Mi Mod';

    // Button
    $_['button_submit']  = 'Presentar';

    // Text
    $_['text_product']     = 'Producto;
    $_['text_category']   = 'Categoría';
    ?>

5. Save the translated file and your site should now show the module in your language

Looking for quality OpenCart Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , | Posted under OpenCart | RSS 2.0

Author Spotlight

Joe Stenhouse

Joe Stenhouse

I am a web application developer that specializes in PHP, JAVASCRIPT, MYSQL, HTML, and CSS. We manifest exciting potentials within the world wide web through means of innovation.

Leave a Reply

Your email address will not be published. Required fields are marked *


7 + 2 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>