I'm trying to generate three pdf files with three different translations
The translations are stored within the directory in the files named by its the language prefix:
lang/pl/global.php
lang/en/global.php
lang/de/global.php
Translations are then stored within GLOBAL VARIABLES for example:
define("SOMEVAR", "SOME VALUE PL"); // for lang/pl/global.php
define("SOMEVAR", "SOME VALUE EN"); // for lang/en/global.php
define("SOMEVAR", "SOME VALUE DE"); // for lang/de/global.php
At the end of some function foo() i'm trying to call the same function translate() three times to generate 3 translated pdf files. Before a call I have to require translation from the directory structure listed above. It looks like:
require('lang/pl/global.php');
translate('pl');
require('lang/en/global.php');
translate('en');
require('lang/de/global.php');
translate('de');
But when I try to print a SOMEVAR global variable from the inside of translate() function it only returns the first prefix translation (SOME VALUE PL) - so in this case it would be 3 times of polish translate (3x SOME VALUE PL). Changing order to en/de/pl results in triple english translate (3x SOME VALUE EN).
I've also tried moving require() to the inside of translate() function but i got no results also.
Any help?
defineis used to set a constant, not to create a global variable.