I want to create a second invoice template to be printed in a different language.
I know how create the new twig template, add the button, etc, but the only issue is that I don't know how to load the 2nd language on the controller instead of the default language.
Text always appears in the English language (the default language of the backend).
I guess that i need to change something to the following part:
Code: Select all
public function invoice() {
$this->load->language('sale/order');
$data['title'] = $this->language->get('text_invoice');
if ($this->request->server['HTTPS']) {
$data['base'] = HTTPS_SERVER;
} else {
$data['base'] = HTTP_SERVER;
}
$data['direction'] = $this->language->get('direction');
$data['lang'] = $this->language->get('code');
.....
OC Version: 3.0.3.8
Any suggestions?
Thanks everyone in advance!