Jump to content

Prestashop 1.7 $this->translator->trans in customerformatter override


2of7

Recommended Posts

I'm overriding the getFormat () function in the customerformatter class. Here $this-> translator-> trans doesn't work.

So what is the best way to call the translation from override?

$format['company'] = (new FormField)
->setName('company')
->setType('text')
->setLabel($this->translator->trans(
'Company', [], 'Shop.Forms.Labels'
));


If I overwrite the whole customerformatter class, obviously everything works. Thank you

Edited by 2of7 (see edit history)
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...