phil
phil

Reputation: 157

Change translation language programmatically

I've got a small problem with a TYPO3 extension.

The extension is translated in english and german (default is german) and I now need to switch the language programmatically.

Reason: We got some cronjobs running that create files using the language selected by the user for certain tasks (e.g. creating bills).

I am using TYPO3 6.x with Extbase and Fluid.

Upvotes: 0

Views: 291

Answers (1)

pgampe
pgampe

Reputation: 4578

In your cronjob, change the language of the current backend user. You can use the $GLOBALS['BE_USER'] variable to access this. It has a property for the language. However, you might need to reinitialize the language service. How a look into the bootstrap to see how this is done.

Upvotes: 1

Related Questions