install_find_locales

6 install.php install_find_locales($profilename)
7 install.core.inc install_find_locales($profilename)

Find all .po files for the current profile.

1 call to install_find_locales()

File

includes/install.core.inc, line 1135
API functions for installing Drupal.

Code

function install_find_locales($profilename) {
  $locales = file_scan_directory('./profiles/' . $profilename . '/translations', '/\.po$/', array('recurse' => FALSE));
  array_unshift($locales, (object) array('name' => 'en'));
  foreach ($locales as $key => $locale) {
    // The locale (file name) might be drupal-7.2.cs.po instead of cs.po.
    $locales[$key]->langcode = preg_replace('!^(.+\.)?([^\.]+)$!', '\2', $locale->name);
    // Language codes cannot exceed 12 characters to fit into the {languages}
    // table.
    if (strlen($locales[$key]->langcode) > 12) {
      unset($locales[$key]);
    }
  }
  return $locales;
}
Login or register to post comments