Language Translation

Inhaltsverzeichnis

Introduction

PepperShop can be operated multilingually on the customer side. This manual describes the necessary work that must be performed so that PepperShop can be operated in another language.

PepperShop uses so-called language sets. These are located in the folder {shop_verzeichnis}/shop/language. Here you will find a folder for each language. A language set consists of the following files:

Some files in the subfolder text_templates belong to modules and may not be present.

The largest part of the files are the language-specific buttons. Much more important, however, and quite inconspicuous, is the file localetext.inc.php, it houses the translated texts of the customer-side display of PhPepperShop. In addition, you will also find the HTML templates, which are localized (by default only the imprint and the start page). As a third element to be translated, there is the file countries.inc.php, which houses the names of all countries in the world. In the shop it serves as the basis for the delivery country selection.

Brief Description

When translating, the following essentially needs to be done:

  • Translation of texts localetext.inc.php, countries.inc.php and .txt files
  • Translation of the welcome page (start_content.tpl.html)
  • Creation of buttons
  • Adjusting the shop and activating the new language set

Preparations

We assume that you are in the directory {shopdir}/shop/langauge. {shopdir} stands for the directory in which PepperShop is installed.

The easiest way is to copy an existing language set folder (e.g. de for German, en for English) and rename the copy to the corresponding ISO-639-1 language code of the new language, e.g. fr (for French) or nl (for Dutch). ISO source e.g.: https://www.loc.gov/standards/iso639-2/php/English_list.php

Translate Texts

Translation with the Localization Editor

Since PepperShop v.2.5 there is an editor for editing the translation texts used in the shop. To do this, switch to the shop administration and there to the Languages menu. Here you will find at the bottom the link ‘Adjust all translated texts’. If you click on this link, you can select the new language and then conveniently perform all entries and translations in the editor. Since the editor is still new, we recommend frequent intermediate saving.

Translation Directly in the Translation File

Now go to the newly created folder and open the file localetext.inc.php. Info: All PepperShop source code files use UNIX line breaks, accordingly the display looks ‘mixed up’ on Windows computers. Use a suitable editor for this.

Before you start the actual translation, you should take a good look at the beginning of the file. Here you should correctly specify the language and also enter your own name and the e-mail address of the translator.

In the localetext.inc.php you must now translate all text passages and adjust the language info (charset, …). You do this by translating each line that begins with $locale_strings as follows. In the square bracket follows a reference, at this you must not change anything. After the equals sign follows the text (part) to be translated. Here it must be ensured that the single quotation mark at the beginning of the text part and at the end of the text part is not lost under any circumstances. For better understanding, comments have been added after certain text parts after two slashes (//). Example of a line:

<?php
$locale_strings['artikel_weiterempfehlen'] = 'Recommend this article';

Many lines have so-called placeholders in the texts to be translated. Placeholders look like this: %s. What the placeholders stand for is written in the comment on the far right, behind the line. The placeholders MUST NOT BE DELETED. They must be placed again in the translated text at the correct location.

Info: Special cases are the last sections Customer Additional Fields, localized Terms and Conditions (General Terms and Conditions), Customer Information and Article Additional Fields at the very bottom in the respective localetext.inc.php. The (Customer) Additional Fields and the Terms and Conditions can be conveniently done for the default language via the web interface (Additional Fields → Customer Attributes, Terms and Conditions → General Shop Settings / Customer Information). If the shop is switched by the customer to the respective language mode and he finds entries in these variables which are either empty or differ from the values stored in the database, the shop uses the values specified in the localetext.inc.php.

Translate Buttons

Once the translation of the texts in localetext.inc.php is complete, you should adjust the buttons in the Buttons subdirectory, in particular the image lang_pic.gif, which contains a pictogram for the language. The button changes should be made via the administration interface. You must not forget that the Buttons folder and all files in it except the index.html must be marked as readable for everyone (UNIX systems only) - this means the Buttons folder must have file access rights 777, the images in it then 666 or 777, this is important, otherwise you may not be able to manage (change) the images later via the shop administration.

The button texts can also simply be given to Glarotech GmbH when handing over a new language set. We will then create a localized button set with the standard buttons.

Translate Welcome Page (in HTML)

What you can do directly via HTML editor, however, is to adjust the file named start_content.html. This is the welcome file that the customer sees when entering the shop (and this language is preselected). You can also edit this HTML template directly via the shop administration.

Optional - Adjust HTML Templates

This is not necessary at the moment, but should be mentioned here because the HTML templates can also contain language-specific changes.

For this you can simply edit the corresponding HTML files in the html_templates subdirectory.

Adjust Text Templates

In the text_templates subfolder there are text files that serve as templates for emails – e.g. to notify the customer that his ordered goods have been delivered. These files also have UNIX line breaks, see the download link to a suitable editor in chapter 4.2.

Put the New Language Set into Operation

Now the ‘language set’ is ready. We can activate it in the shop. To do this, go to the administration menu and there to the Languages submenu. Here you will now see the new language newly listed and marked as available. With a click on the box below ‘activated’ and after saving, the new language is then available.

Use Exclusively This Language

If you now want to use exclusively this language in your own shop, you must go to the configuration editor (Shop Settings - Shop Configuration - Configuration - “View and edit control constants of this shop” - Configuration Editor) and define the constant with the ISO-639-1 code of the language at DEFAULT_LANGUAGE (see also comment on the line there).

Adjust Search Engine Optimization Tags of PhPepperShop

When operating exclusively with the newly translated language:

In the file {shopdir}/shop/shopindex.php and katalog.php add the country at DC.Coverage (2 times and 4 times). This is necessary so that the search engine indexing of PhPepperShop sets the Dublin Core meta tags for the country correctly.

Where to Put the Language Set?

Anyone who has created a language set can send it to us compressed in one of the formats listed below to developers@phpeppershop.com.

If it is too much effort to create the entire language set, it is enough for us to send the translated localetext.inc.php together with the email templates and in the email also mention the translated lettering on the buttons. We will then create the buttons here.

Further Details / Information

Further information can be found in the info.txt file, which is located in every PepperShop in the directory {shopdir}/shop/language/. It also explains the translation mechanism.

Further Help

Do you have questions or need assistance? Do you have special requirements or desire a custom solution for your system? Our support team is happy to help. Support services are charged based on time and material at CHF 195.- / hour. Here is how to reach us:

Other Useful Pages

🌶️
🔥
🌶️