Commit 0cb3b602 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

Initialize languages for each profile on platform verify

parent bd04ac1b
......@@ -496,6 +496,7 @@ function _provision_find_profiles() {
return FALSE;
}
while (FALSE !== ($name = readdir($dir))) {
$languages = array();
$file = "./profiles/$name/$name.profile";
if ($name == '..' || $name == '.' || !file_exists($file)) {
continue;
......@@ -513,9 +514,11 @@ function _provision_find_profiles() {
$languages['en'] = 1;
// Find languages available
$files = array_keys(file_scan_directory('./profiles/' . $name . '/translations', '\.po$', array('.', '..', 'CVS'), 0, FALSE, 'filepath'));
foreach ($files as $file) {
if (preg_match('!(/|\.)([^\./]+)\.po$!', $file, $langcode)) {
$languages[$langcode[2]] = 1; // use the language name as an index to weed out duplicates
if (is_array($files)) {
foreach ($files as $file) {
if (preg_match('!(/|\.)([^\./]+)\.po$!', $file, $langcode)) {
$languages[$langcode[2]] = 1; // use the language name as an index to weed out duplicates
}
}
}
$profile->info['languages'] = array_keys($languages);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment