Are you a PrestaShop 1.6 module developer and do you need to add translations for your module?

Then check out these pitfalls that are not mentioned in the PrestaShop documentation.

  1. When on the “Localization -> Translations” page, choose “Type of translation” -> “Installed Modules Translations”.
    Now you are allowed to change the second value which should be “Core (no theme selected)”.
    Only then saving the translations will result in a language file in your modules’ /translations/ directory.

    This is not mentioned in the documentation.

  2. When you’ve divided your module into different classes and you do something like $parent->l(‘Some string’); then make sure to add your module’s name as a second parameter, like: $parent->l(‘Some string’, $parent->name);
    Otherwise, the translation system will register the origin of the untranslated string to be another class of your module, which is fine.
    But when you’ve translated it and expect things to work you’ll be dissappointed.

    That’s a bit hard to understand so here’s what happens visualization:
    The module will store your translated string as:

    $_MODULE['<{mymod}prestashop>mysubclass_63371c756054ac7f52a550114e9c108d'] = 'Hi, my name is John';

    But it won’t work because it later will look for:

    $_MODULE['<{mymod}prestashop>mymod_63371c756054ac7f52a550114e9c108d'] = 'Hi, my name is John';
  3. Point #2 doesn’t apply for smarty translations.
    If you have a template with

    {l s='Hi, My name is John' mod='mymod'}

    then the translation module will store your translated string just fine.

Hope this serves you somehow!