How to translate Prestashop to other languages?

Maybe have you ever faced that you need to translate the range of your store into another language. Manual work is of course the best, but sometimes just even a rough machine translation.

In that case, You can throw this procedure using the prestashop-cli and translate-shell . The installation of these SW is not part of this manual, and is on the site of these projects. I assume, that everything you have installed and configured.

the Next step is to turn on another language in Your store. You do this through the Localization/Import of files of localization. Select your country and import it. Don't forget that you will need to configure and template Prestashop, because it is for each country to the other. Subsequently, we proceed to the translation.

Part of the prestashop-cli is a set of translate-objects.sh , which makes the work easier. For starters, translate the names of the categories. So far, don't worry, the script only prints the commands, whereby the translation carried out, but the shop does not perform any changes.

cd prestashop-cli
. env.sh
./contrib/translate-objects.sh categories name cs en translate_google

the Result will be something like:

Ointments ==>> ointments
psupdate --base64 --language=4 category 12 name=b2ludG1lbnRzCg==
Oil ==>> oils
psupdate --base64 --language=4 category 13 name=b2lscwo=


Thus we see how a povedly individual translations and we can also see mpříkazy, which předklady really perform. translate_google means that for the translation used Google translator. You can still use the translate_yandex for use yandexu or write your own function. This is expected on the standard input the source language and to output target.

my_translate() { echo "Predklad $*"; }
./contrib/translate-objects.sh categories name cs en my_translate

Similarly as with categories, we can translate other stuff, mainly products. Since google engine to spoil the HTML, it cannot be used for the description and description_short. Therefore, it is appropriate to translation to do for example as follows:

./contrib/translate-objects.sh products description,description_short cs en translate_yandex >mytranslate.sh
./contrib/translate-objects.sh products name cs en translate_google >>mytranslate.sh
./contrib/translate-objects.sh categories name cs en translate_google >>mytranslate.sh
./contrib/translate-objects.sh categories description cs en translate_yandex >>mytranslate.sh

Still we did not make any changes in the shop, only we have prepared a translation of the script. If you are sure that you want the translation done, just run:

. mytranslate.sh

I Hope that this tutorial at least three shall be assisted by : a) If yes, you can star or donate project prestashop-cli :)


 

 

 

Recent comments

No comments available.

Who's new

  • radimk
  • limo