Tool to build Joomla Language files from xml / php files
$builder = new LanguageFiles();
$builder->buildComponent('com_foobar');
// the tool has created both admin and site language files for every language in the joomla installation you run this into