Reputation: 259
Is it possible to temporary switch a language with the php gettext module? I would like to change the language since an e-mail should be generated in two language for two different receivers.
Upvotes: 2
Views: 660
Reputation: 158190
You need to set the LC_*
variable(s). Like this:
putenv('LC_ALL=de_DE');
setlocale(LC_ALL, 'de_DE');
renderEmail();
putenv('LC_ALL=en_US');
setlocale(LC_ALL, 'en_US');
renderEmail();
Upvotes: 3