I've language files like "en.lang.php":
/* english language */
return array(
"random.key.one" => "random value one",
"random.key.two" => "random value two);
Usage (the quick & dirty way):
/* random_template.php */
$language = "en";
$file = $language . ".lang.php";
$text = include($file);
echo $text["random.key.one"]; // "random value one"
Question: How is it possible to use this values in JavaScript?
Idea: Generate en.lang.js with a function that returns the needed value, usage:
alert(get_text("random.key.one"));
Problem: I've to flush the cache everytime the *.lang.php-file was changed. Not that user-friendly.
Thanks in advance!