Jump to content
Sign in to follow this  
SnakeChord

Localization

Recommended Posts

Hello.
I created a simple module for PS. I tried to localize this module.

When I am in the localization page I see.

MYLOANCONNECTOR -> my main.php file
MLCCONFIG -> my second file with some static values 

Result of generation file:

global $_MODULE; $_MODULE = array(); 
$_MODULE['<{myloanconnector}prestashop>myloanconnector_45ede5b149bf7c7fa0507a1617393da3'] = 'xxxxxxx'; $_MODULE['<{myloanconnector}prestashop>mlcconfig_9810fe391f2e0a0d0644004e1073321e'] = 'xxxxxxx'; 

But if I try to get localization in mlcconfig.php file:

$module = Module::getInstanceByName('myloanconnector'); /

/ Init Fields form array $fields_form = []; $fields_form[0]['form'] = [ 'legend' => [ 'title' => $module->l('xxxxxxx'), ],

I don't get the localization text.
Why? 

Can you help me? What did I do wrong.

 

 

SOLVED-  I must use , __CLASS__) as second parameter in l method.

 

Edited by SnakeChord (see edit history)

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...

Important Information

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