Finds all .po files that are useful to the installer.
An associative array of file information objects keyed by file URIs as returned by file_scan_directory(). English is removed from the array and the object is prepared for database insertion.
function install_find_translations() {
$files = install_find_translation_files();
// English does not need a translation file.
array_unshift($files, (object) array(
'name' => 'en',
));
foreach ($files as $key => $file) {
// Strip off the file name component before the language code.
$files[$key]->langcode = preg_replace('!^(.+\\.)?([^\\.]+)$!', '\\2', $file->name);
// Language codes cannot exceed 12 characters to fit into the {language}
// table.
if (strlen($files[$key]->langcode) > 12) {
unset($files[$key]);
}
}
return $files;
}