Translating or renaming your OpenCart extension
By default, OpenCart supports multi-language setup - there is a language directory/folder in both the admin
and catalog
directories/folders, which contains all the naming for the different pages and extensions on your OpenCart website.
As the name suggests, the language files in the admin directory/folder is for your OpenCart admin
dashboard, and the language files in the catalog
directory/folder is for the frontend or customer-facing side of your OpenCart website.
All of our extensions only come with English as the default language. If you wish to translate our extensions or any third-party extensions or for OpenCart in general, please ensure that you have the language pack installed on your OpenCart website already.
For renaming and translating, please refer to the sections below for the OpenCart version that you are using:
OpenCart 1.5.x.x to 2.2.x.x
The default English language files are located in the following directories/folders:
admin/language/english
catalog/language/english
For extensions/modules, the language files are located in the following directories/folders:
admin/language/english/module
catalog/language/english/module
For shipping and payment extensions, the language files are located in the following directories/folders:
admin/language/english/shipping
admin/language/english/payment
catalog/language/english/shipping
catalog/language/english/payment
To rename in English, simply go to the desired location and open up the
.php` language file(s), and make the changes there.
To translate to another language, we recommend copying out the .php
language file(s), and pasting them into the language's directory/folder, in the same sub-directory/sub-folder.
For example, to translate the default "Featured" module from English to French, you can copy the language files below, then translate the texts in the copied file:
featured.php
inadmin/language/english/module
toadmin/language/french/module
featured.php
incatalog/language/english/module
tocatalog/language/french/module
Please note that the above is just an example, and default OpenCart language files should have already been translated when you install a language pack. Also, certain developers may place their extensions in another directory/folder, so it may vary from extension to extension.
OpenCart 2.3.x.x to 3.x.x.x
From OpenCart 2.3.x.x onwards, the language files are now placed in directories/folders named after the language's ISO code. Extensions and modules are also now shifted into the extension
directory/folder.
The default English language files are located in the following directories/folders:
admin/language/en-gb
catalog/language/en-gb
For extensions/modules, the language files are located in the following directories/folders:
admin/language/en-gb/extension/module
catalog/language/en-gb/extension/module
For shipping and payment extensions, the language files are located in the following directories/folders:
admin/language/en-gb/extension/shipping
admin/language/en-gb/extension/payment
catalog/language/en-gb/extension/shipping
catalog/language/en-gb/extension/payment
To rename in English, simply go to the desired location and open up the
.php` language file(s), and make the changes there.
To translate to another language, we recommend copying out the .php
language file(s), and pasting them into the language's directory/folder, in the same sub-directory/sub-folder.
For example, to translate the default "Featured" module from English to French, you can copy the language files below, then translate the texts in the copied file:
featured.php
inadmin/language/en-gb/extension/module
toadmin/language/en-gb/extension/module
featured.php
incatalog/language/en-gb/extension/module
tocatalog/language/en-gb/extension/module
Please note that the above is just an example, and default OpenCart language files should have already been translated when you install a language pack. Also, certain developers may place their extensions in another directory/folder, so it may vary from extension to extension.
OpenCart 4.x.x.x
From OpenCart 4 onwards, the directories have been restructed quite a bit. The default English language files for core OpenCart are the same as previous version, and are located in the following directories:
admin/language/en-gb
catalog/language-en-gb
However, for third-party extensions, the language files are separated. You should be able to find them in these directories:
extension/<extension_name>/admin/language/en-gb
extension/<extension_name>/catalog/language/en-gb
Where <extension_name>
is referring to the extension's name which you've installed. For example, if you 've installed the OpenCart Official PayPal extension, then the default English language files can be found under extension/paypal/admin/language/en-gb
and extension/paypal/catalog/language/en-gb
.