Jump to content

[ANSWERED] Proper way how to make text strings in modules translatable.


Andrej Stas

Recommended Posts

How do you prepare your modules for translations? Here's the problem:

 

This is the new 1.7 way how we should insert all texts in TPL files in our new PS 1.7 modules:

{l s='Thank you for your purchase!'  d='Modules.Ptm_Paypal.Shop'}

 

And in .PHP files:

$this->displayName = $this->trans('Payments by Paypal', array(), 'Modules.Ptm_Paypal.Admin');
 
 
This solution is recommended by Prestashop, even used in some of their modules (for example ps_customtext)
 
So what is the problem?
 
It doesn't work! No text strings are detected for translation in the back office!
 
So the other option is to fall back to the former way, that is not recommended:
 
{l s='Thank you for your purchase!' mod='ptm_paypal’} (TPL)
$this->displayName = $this->l('Payments by Paypal'); (PHP)
 
And this one works, although it is deprecated.
 
What are your ideas? Especially if Prestashop developers read this forum - it should be amongst the TOP bugs to fix.
Edited by Andrej Stas (see edit history)
Link to comment
Share on other sites

i've got the same problem.

moreover - no matter what method i will use im not able to find these strings in back office translations feature.

 

I see, so the problem is not only within our team. I will report the bug on forge.prestashop.com if it hasn't been already done.

Link to comment
Share on other sites

Hey guys!

 

I need to update the doc about this, but to make it short, the new 1.7 way does not work for module. Module developers need to use the 1.6 way.

 

More details here http://build.prestashop.com/news/new-translation-system-prestashop-17/ (specifically: https://github.com/PrestaShop/prestashop.github.io/commit/9dd32c7ceeb7a6664e64cf6e42ffdae5b8ff6a7c )

 

Doc will be updated this week.

Link to comment
Share on other sites

Hey guys!

 

I need to update the doc about this, but to make it short, the new 1.7 way does not work for module. Module developers need to use the 1.6 way.

 

More details here http://build.prestashop.com/news/new-translation-system-prestashop-17/ (specifically: https://github.com/PrestaShop/prestashop.github.io/commit/9dd32c7ceeb7a6664e64cf6e42ffdae5b8ff6a7c )

 

Doc will be updated this week.

 

Hi Xavier, thank you for the update!

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...