Jump to content

New Module - Wrong Translation Path


Recommended Posts

Hello,

 

hopefully someone can help me on this:

 

Im trying to learn how to program a new module for prestashop. I was searching for tutorials and for me the native prestashop documentation seemed to be the best one. So i started to use this documentation (Documentation) to create a new module form scratch.

 

Now I reached the part, where the translation is described. Somehow I ran into issues following the documentation because when I now go in the backend->localization select Module translation and Core, I see my module and the words that can be translated.

 

But if I try to translate one of those words and klick save, prestashop shows an error.

 

Mainly it says, that prestashop has no write permissions to save this translation. But if I look carefully at this error, it shows the directory, where it tries to save the translation. And somehow this directory is not the one of my module. For core translation it tries to save the translation in aeuc (advancedeucompliance) and for theme translation it tries to save in blockproductlist.

 

Does anyone know, if I have to tell the module in some place, where to save translations? I thought this is part of prestashop and will be done automatically.

 

[Yes, i searched already any Keyword-Search with google and this forum and sorry, but I couldnt find any hint!]

 

Im thankfull for any answer!

 

[Edit: Im using Prestashop 1.6.1.1]

Edited by MrBrown997 (see edit history)
Link to comment
Share on other sites

Hey roja45,

 

thanks alot for your reply.

The module was completely created from scrath using the documentation of PS 1.6. No copy or anything else was made.

 

Here the code you asked for:

 

  public function __construct()
  {
    $this->name = 'testmodule';
    $this->tab = 'front_office_features';
    $this->version = '0.1';
    $this->author = '#####';
    $this->need_instance = 0;
    $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
    $this->bootstrap = true;

    parent::__construct();

    $this->displayName = $this->l('Test Module');
    $this->description = $this->l('Testmodule.');

    $this->confirmUninstall = $this->l('Are you sure you want to uninstall Test Module?');

    if (!Configuration::get('testmodule'))
      $this->warning = $this->l('No name provided');
  }

Link to comment
Share on other sites

 

But if I try to translate one of those words and klick save, prestashop shows an error.

 

Mainly it says, that prestashop has no write permissions to save this translation. But if I look carefully at this error, it shows the directory, where it tries to save the translation. And somehow this directory is not the one of my module. For core translation it tries to save the translation in aeuc (advancedeucompliance) and for theme translation it tries to save in blockproductlis

if you hit save there - prestashop saves ALL TRANSLATIONS, not only translations related to your module.

prestashop saves all translations one by one for each module. so if some of the directories (or translation files like en.php, es.php it.php etc.) will not have writable permissions prestashop will spawn error.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...