Admin UI Translation

Having a multi-language admin

Admin Multi-Language Support

Prior to v2.1.0 very little of the Admin Interface would “display” in a language other than English.

Admin Configuration Menu Translations Since v1.5.5 it was possible to define translations in language packs for the Admin “Configuration” menu using a few override conventions:

//For example, in admin/includes/languages/spanish/lang.configuration.php

define('CFGTITLE_STORE_NAME', 'Nombre de la Tienda');
define('CFGDESC_STORE_NAME', 'El nombre de mi tienda');
define('CFG_GRP_TITLE_MY_STORE', 'Mi Tienda');

Now with v2.1.0 this is expanded to more areas:

For product_types:

The product_type type_name can be defined using 'PRODUCT_TYPE_NAME_FOR_HANDLER_' followed by the product_type’s uppercase type_name

Example for French:

    'PRODUCT_TYPE_NAME_FOR_HANDLER_PRODUCT' => 'Produit - Général',
    'PRODUCT_TYPE_NAME_FOR_HANDLER_PRODUCT_MUSIC' => 'Produit - Musique',
    'PRODUCT_TYPE_NAME_FOR_HANDLER_DOCUMENT_GENERAL' => 'Document - Général',
    'PRODUCT_TYPE_NAME_FOR_HANDLER_DOCUMENT_PRODUCT' => 'Document - Produit',
    'PRODUCT_TYPE_NAME_FOR_HANDLER_PRODUCT_FREE_SHIPPING' => 'Produit - Envoi Gratuit',

And for Product Type layout/configuration settings (found in product_type_layout table’s configuration_title and configuration_description fields): 'PRODUCT_TYPE_LAYOUT_TITLE_FOR_' followed by uppercase configuration_key 'PRODUCT_TYPE_LAYOUT_DESC_FOR_' followed by uppercase configuration_key

French examples:

    'PRODUCT_TYPE_LAYOUT_TITLE_FOR_SHOW_PRODUCT_INFO_MODEL' => 'Afficher le modèle',
    'PRODUCT_TYPE_LAYOUT_DESC_FOR_SHOW_PRODUCT_INFO_MODEL' => 'Afficher le numéro de modèle dans les informations de produit 0= off 1= on',
    'PRODUCT_TYPE_LAYOUT_TITLE_FOR_SHOW_PRODUCT_INFO_WEIGHT' => 'Afficher le poids',
    'PRODUCT_TYPE_LAYOUT_DESC_FOR_SHOW_PRODUCT_INFO_WEIGHT' => 'Afficher le poids dans les informations de produit 0= off 1= on',
    'PRODUCT_TYPE_LAYOUT_TITLE_FOR_SHOW_PRODUCT_INFO_MANUFACTURER' => 'Afficher le fabricant',
    'PRODUCT_TYPE_LAYOUT_DESC_FOR_SHOW_PRODUCT_INFO_MANUFACTURER' => 'Afficher le nom du fabricant dans les informations de produit 0= off 1= on',
(and there are a few dozen more possible entries that can be translated this way)

For Plugins listed in the Plugin Manager In your plugin’s language file, add a define: 'ADMIN_PLUGIN_MANAGER_DESCRIPTION_FOR_' followed by the uppercase english Description

French examples:

    'ADMIN_PLUGIN_MANAGER_DESCRIPTION_FOR_DISPLAYLOGS' => 'Affiche et gère les fichiers journaux de Zen Cart.',
    'ADMIN_PLUGIN_MANAGER_DESCRIPTION_FOR_POSM' => 'Ce plugin permet à votre site d\'attribuer des niveaux de stock et des numéros de modèle à vos produits en fonction de combinaisons produit-attributs (également appelées « variantes de produit » ou « stock par attributs »).',

Translations Added When Installing A Language Pack

When a Language is added to the Admin via the Languages page, not only do you specify the “directory name” where the language-pack files are to be found, but Zen Cart also makes copies of a LOT of database-records to support that language. It copies the English version of products, categories, and other things, and then you are free to edit those names/descriptions to translate them into your other language. Be sure to check out the Order Statuses page. And check out any plugins that allow multiple languages, such as POSM.




Still have questions? Use the Search box in the upper right, or try the full list of FAQs. If you can't find it there, head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified August 31, 2024 by Chris Brown (43676c7f).