Jump to content

Translation Problem, While Using Smarty->Fetch() In A Controller.


Recommended Posts

Hi guys,

I have made a diagnostic module for my website. After answering a few questions, my users get a result page with recommendations of products interesting for them.

I also want to send these result page. So i figure out I will use the smarty fetch function to get the page in a PHP variable and then send it by mail.

It works great, except for one thing: the strings which are to be translated.
They use the classic PS syntax:
{l s=’some text string’ mod=’modulename’}

Here is the code I use for my fetch:

$this->context->smarty->assign($nut_vars);    
$this->context->smarty->fetch('result_mail.tpl')

I use PS 1.6.

 

$this -> context -> language -> id is correctly defined in my controller.
When I use {debug}, the language id is also properly visible in the smarty variable.

Yet no way to translate them.
Do you have any idea?

Otherwise, I will do two templates and use one or the other when calling the fetch function, based on the language id

Thanks,
Jeremie
 

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