Post by Qphoria » Wed Apr 20, 2011 2:50 am

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?

A:
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:

Code: Select all

<?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:

Code: Select all

<?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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 2 guests