Jump to content
Ehinarr

[Solved] How can I make this line translatable?

Recommended Posts

Hi all,

I want to make translatable "Mobile Phone Number:" in this line below:

$mobilephoneString = "Mobile Phone Number:{$mobilephoneNumber} 
";



regards

Share this post


Link to post
Share on other sites

Hi ehinaar,

Where is this line ? in a template file, in a module controlleur, in a front controller or in a class ?

Usually, the translation is accessible like this :

$mobilephoneString = $this->l('Mobile Phone Number:').' '.$mobilephoneNumber;


but i think this line is in a template, so this is the code :

{l s='Mobile Phone Number:'} {$mobilephoneNumber}



Regards,
Joel

Share this post


Link to post
Share on other sites

Wow, thanks for your fast and accurate reply.

First option: in a module, and it works fine.

Thanks a lot.

Share this post


Link to post
Share on other sites

And how to translate this line here?:
this is a module

<a class="button" href="{$product.link}" title="{l s='more view'}">{l s='more view'}</a>

I already try the codes above and din'd not work

 

Prestashop 1.5.6.2

 

tanks

Edited by majority (see edit history)

Share this post


Link to post
Share on other sites

everything depends on where you used this code. can you elaborate, please?

Share this post


Link to post
Share on other sites

everything depends on where you used this code. can you elaborate, please?

Hi, tanks for the reply Vekia

 

I have figure it out, this code is from a module that displays feature products on the home page

but the developer forgot to make the (more View) button translatable on the backoffice

the solution I have found is this:

 

Original Code (not translatable):

<a class="button" href="{$product.link}" title="{l s='more view'}">{l s='more view'}</a>

Modified Code (Translatable):

<a class="button" href="{$product.link}" title="{l s='more view' mod='your_module_name'}">{l s='more view' mod='your_module_name'}</a> 

where your_module_name is the name of the module that we want to be translatable

 

Best regards

Edited by majority (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

that's correct, this is why i asked about place where you added code you mentioned :)

thanks for detailed reply, with regards,

Milos

  • Like 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More