Language Variables in Add-ons

Language Variables in Venddor IO Modules

Language variables serve as an essential tool for ensuring multi-language support for your Venddor IO modules. Instead of hardcoding texts, these variables offer flexibility to cater to various languages based on user settings.

How Language Variables Operate

  1. Using Language Variables:

    Direct texts aren't embedded within PHP code or Smarty templates. Instead, a specific function retrieves the appropriate text based on the language variable provided. This function ensures the display of text matches the user's locale.

  2. Storage in PO Files:

    The translations for modules in Venddor IO are held in PO files. Each language possesses its dedicated PO file, categorized under its specific language code folder: var/langs/[language_code]/addons/[module_name].po.

    For instance, the English translations for a module named "User Restrictions" would be stored at var/langs/en/addons/user_restrictions.po. Note that the PO file's name should align with the <id> content in app/addons/<module_name>/addon.xml.

Lifecycle of Language Variables

Modules in Venddor IO leverage these language variables to offer a dynamic, user-centric experience, adapting seamlessly across multiple languages. It promotes flexibility and a tailored approach, essential for a global audience.