Jump to content

How to change PDF setting for the current language to Non English- V.1.4


Recommended Posts

  • 9 months later...

the invoice should be created using the language of the person logged in and viewing it. you may need to create those translations in the Tools | Translations section of the back office.

 

Under Modify translations section, choose PDF Translations and then click the appropriate flag to edit them.

Link to comment
Share on other sites

i had stated in my previous thread, that the invoice is always displayed in the language of the logged in user. since you said your back office default is english, then i would expect you to see the invoice in english.

 

when you tested a client order from the front office, what language did you select?

Link to comment
Share on other sites

ok, so the back office apparently is working properly, since the language is english, and the invoice is displaying in english, true?

 

for the front office, did you ensure that the PDF Translations exists for that language? Also, when you made the purchase, was the language english or Estonian? the language is stored at the order level, so even though you have selected Estonian for the front office, it may be showing english if you checked out originally as english.

Link to comment
Share on other sites

I just figured out thanks to you, bellini! Back office invoice created in that language which are chosen by employee.

Back office -> Employee -> pick one -> set proper language. That's it in my case.

 

Simple as that, but somehow it does not make any sense before.

 

Sorry for my really bad English and THANK YOUUU!!! bellini13.

Link to comment
Share on other sites

Well, After two days hacking, if I got the right concept, I need to replace: self::l('INVOICE #') which 'L' is the core function to using the current language the user selected.

 

I decided to just input English to pdf translation for all fields.

Tools > Translation > modify translation > pdf translation : all fields use English. So, INVOICE# : 'Invoice #'

 

If I got wrong, any recommendation would be welcome.

Link to comment
Share on other sites

  • 2 weeks later...

PDF.php has a construct function, which looks at a cookie to determine the language to use. I would have just altered this function so it hardcodes to english.

 

	public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4')
{
	global $cookie;

	if (!isset($cookie) OR !is_object($cookie))
		$cookie->id_lang = (int)(Configuration::get('PS_LANG_DEFAULT'));
	self::$_iso = strtoupper(Language::getIsoById($cookie->id_lang));
	FPDF::FPDF($orientation, $unit, $format);
	$this->_initPDFFonts();
}

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