After doing development of so many modules for opencart, I realised an issue that so many our clients faced specially those, who don’t use the English language as store’s default language.
We’ll be using Spanish language pack for example which you can download from here.
Download the zip and unzip it and then upload files to opencart setup. Next step is adding new language, for this go to system->localization->languages and click on add new button. You’ll get below page to fill details about language that you are about to add.
To fill above form, every language pack provider provide details like below.
Fill these details in the above screenshot form as below.
And now just save it and you’ll see in the languages list as below.
As you can see that as of now default language is still english, that you have change from system->setting under the local tab, there is an option of language option, change it to spanish and default language will become spanish for store.
The next major issue is, how to translate a module that is built on the multi language paradigm. If module is following language pattern for any module then it must have language files.
If the module has language files for English and you want to translate them for Spanish, then at the very first copy all the language files from English language directory and paste all of them in Spanish directory in the same structure as it was in English language.
For example, there is a file in module directory for English language called foo.php then copy this into the module directory of Spanish language.
Suppose Enlish file has these keyword to be translated as below screenshot.
Then these will be translated to Spanish as below.
After doing above changes, when you’ll change the language from front end then, page will be translated in to Spanish language only for those keywords that exists in language file only.
4 comments
Hello Mahmoud,
You can follow this blog to translate the store language into the required one.
Apart from that, for translating webkul’s OpenCart Multi-Vendor Marketplace, what you can do is –
We already provide the English language file and you can translate it into Arabic language.
You have to first copy all the language files from the English language directory and paste all of them into the Arabic directory in the same structure as it was in the English language.
After that, the language file initially has the keywords in the English language. Here, you have to replace the keywords with the Arabic Keywords as required.
For, example initially the keywords were in Spanish, you can add the Arabic keywords there – http://tinyurl.com/yu4de7kp
After making the above changes in the language file, when you change the language from the front end, the page will be translated into Arabic language only for those keywords that exist only in the language file.
Warm Regards,