PrestaShop 1.4 Languages Tutorial

How to install, add and enable languages in PrestaShop

In this tutorial we'll show you how to install PrestaShop language packs, how to add and enable them, and also how to update existing language packs.

These things can be done from the backend of your PrestaShop store. First of all, if you haven't already noticed, PrestaShop comes prepackaged with five different languages: English, French, Spanish, German and Italian. During the installation process you were asked to choose one of these five languages to be the default for your store. Once the installation is complete, however, you can enable the other four languages.

To do this click on the Tools tab of your store's backend and then on the Languages sub-tab. You'll see a table with the installed and added languages. To enable a language simply click on the red "X" icon for that language:

Enabling Installed Languages

Customers will be able to choose from the enabled languages from the language block at the top of the frontend of your store, unless you have disabled/uninstalled the language module, or you have removed it from its hook (position). You can enable and disable languages at any time you want.

In addition to these five languages you can choose from almost 40 other languages. You can see the available languages in the download section of the official PrestaShop site. There you can also see actually how much of PrestaShop is translated into the respective language (in percents). Many of the translations are in fact not 100% complete.

To install new languages, click on the Tools tab of your store's admin panel and then on the Translations sub-tab. On the page that opens you can choose from a couple of ways for adding new languages. One of the options is to use the automatic installer, and the other is to do it manually.

To use the automatic language installer/updater, from the drop-down menu in the section labeled Add/Update a language select the language you want to install and then click on the Add or update a language button. In our example we have chosen to install Portuguese:

Adding a Language Using the Automatic Installer

After you click on the button the language archive will be automatically transferred and uploaded to the translations folder in the root directory on your PrestaShop hosting account, and it will also be uncompressed. From this same section of the Translations sub-tab page you can also update the languages that are already installed on your account. Keep in mind that if you have made any modifications to the particular language, they will be lost during the upgrade.

The other method to install/import a language is to do it manually. First, you need to have the language pack on your local computer. You can download language packs from the download section of the official PrestaShop site.

Of course, you may have a language archive pack created by somebody else. For example, for a language that can't be found on the official site. In any case, once you have the archive on your local computer, find the section Import a language pack manually on the Translations sub-tab page of the your store's admin panel, click on the Browse button to locate the language archive on your local computer and click on the Import button:

Adding a Language Manually

After you click on the Import button the language archive will be uploaded and uncompressed in the appropriate folder on your account.

If your current theme is the default prestashop theme that comes with the PrestaShop installation package, and you're installing a language pack from the available ones on the official site, this should be enough for the language to be imported and enabled, whichever method of the two you decide to use. In case the language was imported successfully and also enabled, you should get a message at the top of the Translations sub-tab page that the language was successfully added:

Translations Successfully Added

You should also be able to see the flag of the country (the Portuguese one in our example) added to the flags of the five default languages in the section Modify translations. It's right under the message. If there's no flag, there should be at least the ISO code for that language: e.g. en for English, fr for French, pt for Portuguese. You can always add a flag image or change the current one from the options for the particular language. You can access these options from the Languages sub-tab of the Tools main tab. We'll come to that a bit further down.

If your theme is not the default one, you'll probably get the following message at the top of the Translations sub-tab page after you import the language: Translations added successfully but the language has not been created. If you get this message, you'll also have to create the language or at least do a couple of other things before the language is fully added.

To create a language and/or change its settings click on the Languages sub-tab of the admin panel's Tools tab. There you'll see the language you just imported listed in the table with the other languages. It will have a yellow triangle with an exclamation mark in it in the column for Enabled:

Language Warning Icon

If you click on the edit icon (a pencil) for that language, you'll see its options. Under the options there should be a warning message that some files are missing. What you have to do is to copy the PHP file for the particular language from the default prestashop theme to your current theme.

For example, our PrestaShop is installed in a folder called shop in the root public_html directory on the hosting account; our current theme is called prestashop_custom, and we have just imported the Portuguese language pack. So we have to copy the file pt.php that's inside public_html/shop/themes/prestashop/lang to the same folder of the current theme: public_html/shop/themes/prestashop_custom/lang. The name of the file depends on the particular language. It consists of the ISO code for the language plus the file extension: e.g. pt.php for Portuguese, en.php for English, etc.

You can use an FTP client to copy the file, or you can do it from the Files section of the Pixie control panel.

After you copy the file, refresh the backend of your store and go the Languages sub-tab of the Tools tab. The warning icon for that language should be gone. In case you have to configure the options for that language, for example to upload a flag image, click on the edit icon. You'll be taken to the screen with the settings for the language:

Language Options

The options are pretty much self-explanatory. The ISO code is a two letter code. There are a few different ISO code variations, what's meant here is the ISO 639-1 code for the language. The available languages on the official PrestaShop site are also listed with the ISO code.

In the field for Data format you can specify how the date should be displayed; for example, whether the year or the day should be displayed first.

To add a flag to the language click on the Browse button next to the field for Flag and locate the image on your local computer. Of course, you need to have the image on your computer first. You can use the flag images from this article in Wikipedia for example, but you have to resize the image a bit because the default flag image size in PrestaShop is 16 x 11 pixels (width x height), and the flag images in that article are just a little bit bigger.

From the "No-picture" image setting you can upload an image that will be shown when there's no product image. This image will be shown on the frontend when customers choose to browse through the store using the particular language. After you configure the settings don't forget to click on the Save button.

As a matter of fact, it's also possible to install a new language by first clicking on the Add new button on the Languages sub-tab page. The same options will be displayed as shown on the screenshot above. After you configure them you can import the language by using one of the two methods available on the Translations sub-tab page. We already described those at the beginning of this tutorial. The order is not that important. You can first add the language from the Languages sub-tab and then import it from the Translations sub-tab, or you can first import it and then add it or configure the language options if necessary.

As we mentioned, some translations are not entirely complete. You can modify any of the installed languages from the Translations sub-tab of the admin panel's Tools tab. The first section on that page is labeled Modify translations. From the drop-down menu in that section select the area of the site for which you want to change or add translations, and then click on the flag for the particular language.