Jump to content

Prestashop 1.5.3.1 Module translations problem


Recommended Posts

Hi everyone.

 

I am trying to translate my installation of Prestashop into Slovak language. Unfortunately, module translations do not show on the website.

 

Phrases that were supplied with the installation are working all right. However, when I try to do further translations in the back-office, everything gets saved correctly, even the sk.php file in the themes\[themename]\modules\[modulename] gets updated. The

 

This is my second Prestashop implementation. In the previous one (same Prestashop version, different template), I had similar problems, but I have worked around them translating the phrases in the TPL files direcly. This time, I will require to have the site in several languages.

 

Namely, I have problem with blockcart module in both default and other themes, but there are also others that are not working (probably all?)

 

Has anyone encountered similar issue, or has a clue how to solve this? Many thanks for any advice on that.

Link to comment
Share on other sites

Hi,

Same thing happened to me after upgrading from 1.5.2. to 1.5.4.

I go to Translations > Intsalled modules translations

 

Click on the flag and i get:

 

Expressions to translate: 0.

Total missing expresssions: 0.

 

At the same time modules like blockuserinfo, blockcart are now in english instead of my language.

 

Help would be appreciated!

Link to comment
Share on other sites

I found the root cause, at least for my problem.

 

Seems like an error in the TPL files of some modules. As an example, a module with name "blocksearchtop" located in themes/[themename]/modules/blocksearchtop

 

in BLOCKSEARCHTOP.TPL, there was {l s='search...' mod='blocksearch'}. I have corrected it to {l s='search...' mod='blocksearchtop'} and everything is working as it should. I have noticed that several other modules in a number of commercial themes have similar issues.

 

@jos0405: I am not sure, if that helps, since it has been working in your previous version.

Edited by lestat95 (see edit history)
  • Like 1
Link to comment
Share on other sites

i upgrade it to 1.5.4, i have same problem too,im dissapointed to upgrade it....i have to translate some of modules but its not available in translations...

 

 

Programmers should fix it..soon....this is a critical bug.... please report it who left,i did it already

Link to comment
Share on other sites

I have not installed the 1.5.4 yet, but did you try to check the translations manually? That solved at least my problem, though it had a different root cause.

 

Example that worked for me (Theme name BALIM, module directory name "blocksearchtop", module TPL filename: "blocksearch-top.tpl" language SK, translated string "search..." in English to "hladat..." in Slovak.

 

Theme modules are located in the "themes/[THEME NAME]/modules" directory.

 

in each module directory, there's [MODULENAME].tpl file, index.php and several [LANGUAGE CODE].php files.

 

in the [MODULENAME].tpl file, look up the strings you need to translate. Example:

 

{l s='search...' mod='blocksearchtop'}

 

the corresponding translation in the language file should be then:

 

<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{blocksearchtop}balim>blocksearch-top_d77a48a51f8c62087570ab8f9d6ca55a'] = 'hľadať...';

 

d77a48a51f8c62087570ab8f9d6ca55a is MD5 hash of "search...". You can easily convert strings in any online MD5 generator...

 

Let me know if that worked for you....

  • Like 2
Link to comment
Share on other sites

I have not installed the 1.5.4 yet, but did you try to check the translations manually? That solved at least my problem, though it had a different root cause.

 

Example that worked for me (Theme name BALIM, module directory name "blocksearchtop", module TPL filename: "blocksearch-top.tpl" language SK, translated string "search..." in English to "hladat..." in Slovak.

 

Theme modules are located in the "themes/[THEME NAME]/modules" directory.

 

in each module directory, there's [MODULENAME].tpl file, index.php and several [LANGUAGE CODE].php files.

 

in the [MODULENAME].tpl file, look up the strings you need to translate. Example:

 

{l s='search...' mod='blocksearchtop'}

 

the corresponding translation in the language file should be then:

 

<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{blocksearchtop}balim>blocksearch-top_d77a48a51f8c62087570ab8f9d6ca55a'] = 'hľadať...';

 

d77a48a51f8c62087570ab8f9d6ca55a is MD5 hash of "search...". You can easily convert strings in any online MD5 generator...

 

Let me know if that worked for you....

 

i rolled back my website to 1.5.3.1 everything fine now....i will wait 1.5.4 when it will be stable and working good.

Link to comment
Share on other sites

I have not installed the 1.5.4 yet, but did you try to check the translations manually? That solved at least my problem, though it had a different root cause.

 

Example that worked for me (Theme name BALIM, module directory name "blocksearchtop", module TPL filename: "blocksearch-top.tpl" language SK, translated string "search..." in English to "hladat..." in Slovak.

 

Theme modules are located in the "themes/[THEME NAME]/modules" directory.

 

in each module directory, there's [MODULENAME].tpl file, index.php and several [LANGUAGE CODE].php files.

 

in the [MODULENAME].tpl file, look up the strings you need to translate. Example:

 

{l s='search...' mod='blocksearchtop'}

 

the corresponding translation in the language file should be then:

 

<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{blocksearchtop}balim>blocksearch-top_d77a48a51f8c62087570ab8f9d6ca55a'] = 'hľadať...';

 

d77a48a51f8c62087570ab8f9d6ca55a is MD5 hash of "search...". You can easily convert strings in any online MD5 generator...

 

Let me know if that worked for you....

 

it explained a lot....REALLY thank you, but i still believe that this should become easier to use...i have to e-shop, one is 1.4 version , works fine in any translation, the other 1.5 is really messed up...i do not know why they changed those thinks but i believe it made our life much more difficult...

I will follow your instructions though and change what i need by hand...(code that is )

 

Thnx again

Link to comment
Share on other sites

I had simmilar issue after I renamed some blocks in english tpl files.

 

I changed this:

<h4>{l s='Welcome!' mod='mymodule'}</h4>

 

after this all other language translations were saved but not displaying.

 

problem was in module's .php files- I forgot to change displayname to new title that I had in .tpl file

 

here:

 $this->displayName = $this->l('My module'); 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

The prestashop translation looks for something that is not there !!!!

 

look up your blockcontact.tpl and make changes

 

SOLUTION

----------------------------------

 

<div id="contact_block" class="block">

<p class="title_block">{l s='Contact us' mod='blockcontact'}</p>

<div class="block_content clearfix">

<p>{l s='Our support hotline is available 24/7.' mod='blockcontact'}</p>

{if $telnumber != ''}<p class="tel"><span class="label">{l s='Phone:' mod='blockcontact'}</span>{$telnumber|escape:'htmlall':'UTF-8'}</p>{/if}

{if $email != ''}<a href="http://localhost/apisdigital_shop/index.php?controller=contact" title="Přejděte na kontaktní formulář">{l s='Contact our expert support team!' mod='blockcontact'}</a>{/if}

</div>

</div>

 

-------------------------------------------

 

I simply changed s='Our support hotline is available 24/7' for s='Our support hotline is available 24/7.' JUST ADDED a dot so it looks into translations and finds this sentence and appropriate language translation for it. Try to change your *.tpl files if you have kind of this problems.

 

Further link is changed for my localhost contact form I dont like that "mailto:"

Link to comment
Share on other sites

  • 2 months later...
I found the root cause, at least for my problem. Seems like an error in the TPL files of some modules. As an example, a module with name "blocksearchtop" located in themes/[themename]/modules/blocksearchtop in BLOCKSEARCHTOP.TPL, there was {l s='search...' mod='blocksearch'}. I have corrected it to {l s='search...' mod='blocksearchtop'} and everything is working as it should. I have noticed that several other modules in a number of commercial themes have similar issues. @jos0405: I am not sure, if that helps, since it has been working in your previous version.

I had the same problem with the module "tmhomefeatured", wich was the "homefeatured" module adapted to my theme.

On the TPL file I had mod='homefeatured' and I changed it to mod='tmhomefeatured' and all the translations were visible on the front.

Thanks a lot for the support!

Link to comment
Share on other sites

  • 1 month later...

Hi everyone,

 

Had a similar problem with a 1.5.3.1 installation. Here is what I found that fixed the issue:
  

  • Make sure your theme is not named 'default' - the translations don't seem to work on overridden module template files inside the default theme. Copy 'default' theme folder and name your theme with 'some-theme-name'
     
  • Activate 'some-theme-name' in the store admin and use it as your store's theme instead of 'default'
     
  • In the override .tpl file in the /themes/some-theme-name/modules/modulename folder, use {l s='some text to translate' mod='modulename'}
      
  • Refresh your page (make sure you are in debug mode, no Smarty caching or anything...)
      
  • Now, in the admin you can browse to Localization -> Translations -> Modify translations then select Installed module translations and then don't forget to choose the 'some-theme-name' theme instead of 'default', then click a flag...
      

That solved it for me. Hope it helps some others as well.

Edited by rbester (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...