Page 1 of 1

force language on a certain module

Posted: Thu Jun 30, 2016 4:09 am
by avoid
Hi,
I want to build an automation to generate the invoice in the language the order was placed but I don't really understand how to force language for the actual invoice generator.

The code to detect the language in which the order was placed should be rather simple:

Code: Select all

if ($order_info['language_id']=='1')
		$inv_lang = 'language1';
			elseif ($order_info['language_id']=='2')
		$inv_lang = 'language2';
			else
		$inv_lang = 'wtf';
The problem is how to force load a language depending on the resulting $inv_lang ...
I did not yet discover how to change the default

Code: Select all

$this->load->language('sale/order');
in order to load an arbitrary language.
Does anybody have an idea how this can be done?