In the following question on multilingual website design, it is suggested to use a PHP "pre-processor" in order to generate localized PHP files. The generation would only be triggered once, and on each update to underlying content.
https://stackoverflow.com/questions/19249159/best-practice-multi-language-website/19425499#19425499
I am currently adapting a website for localization using this approach, but I'm wondering what suggestions people have for dealing with javascript files within this framework.