Knowband Blog | Ecommerce Modules

PrestaShop Introduces a New Translation System

PrestaShop is a well-known open-source e-commerce platform which has released PrestaShop version 1.7.6, which includes a new Prestashop translation system meant to enhance online stores’ multilingual capabilities. This new system offers improved accuracy, efficacy, and user-friendliness, and addresses the drawbacks of previous translation techniques. In this blog post, we will provide a thorough technical explanation of PrestaShop’s new translation system, highlighting its features, architecture, and benefits.

Context and Purpose:-

The ability to offer information in many languages is essential for addressing a varied customer base as e-commerce continues to grow globally and conventional translation systems frequently suffer from errors, inefficiencies, and human labor.

Classic vs. New Prestashop Translation System

Classic Translation System: –

The classic translation system in PrestaShop was primarily file-based and less flexible:

New Translation System: –

The new Prestashop translation system offers several improvements:

Demonstrating the New Prestashop Translation System with a Demo Module

Let’s walk through creating a demo module to showcase the new translation system for Prestashop. We’ll call this module ‘kbdemotranslation’.

Step 1: Setting Up the Module Structure

First, create the basic structure of your PrestaShop module. Your directory structure should look like this:

Step 2: Setting Up the Module’s Main File

Create the main module file kbdemotranslation.php:

Therefore, in this main module file, we define the module class, its metadata, and the basic installation and uninstallation methods. The getContent() method is where we assign the translated strings to Smarty variables and render the configuration template.

Here, ‘Modules.Kbdemotranslation.Kbdemotranslation’ is the translation domain of the text.

Step 3: Creating the Template File 

Create custom template file named ‘configure.tpl’ in the views/templates/admin directory of the module:

This template file displays the translated strings assigned in the getContent method. The ‘nofilter’ modifier is used to ensure that HTML tags in the translations are rendered correctly.

Step 4: Adding Translations via the PrestaShop Back Office

With the module structure and files in place, the next step is to add translations via the PrestaShop back office. Here’s how you can do it:

Further, after adding translations, these translations will be stored in the database and automatically applied when the module is used.

Translation Domain:

The translation domain used by PrestaShop is below-

Modules.Nameofthemodule.Specificpart

Conclusion

Moreover, the new Prestashop translation system represents a significant advancement in managing multilingual content for e-commerce stores. By addressing the challenges of traditional translation methods and introducing innovative features, PrestaShop provides merchants and developers with a powerful tool to enhance their global reach. Hence, the system’s technical robustness ensures improved efficiency, accuracy, and scalability, making it an essential component for any business looking to expand its international presence.

You can also explore a wide range of Prestashop, Opencart, WooCommerce, Shopify, and Magento 2 ready-to-use eCommerce extensions.

In case you have queries/suggestions, you can reach out to our technical support portal at our email address support@knowband.com.

Take a look at our bestseller module One Page Supercheckout for Prestashop and Android and iOS App Maker for Prestashop.

Recommended blog: 

All You Need to Know About New Prestashop 8.1.5

Which One To Choose: PrestaShop 1.7 or PrestaShop 8.1?