diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-28 18:17:27 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-28 18:17:27 +0000 |
commit | 52ba5cc84c0d6e47913392a1df666b8b6cd27952 (patch) | |
tree | 183256847b8e8428f435ad7c21688b30757ac6f4 /includes/install.inc | |
parent | a45a4c4d48ce3cc3768b2d3bfcae55f78a630b3e (diff) | |
download | brdo-52ba5cc84c0d6e47913392a1df666b8b6cd27952.tar.gz brdo-52ba5cc84c0d6e47913392a1df666b8b6cd27952.tar.bz2 |
#994500 by Gábor Hojtsy: Fixed Drupal should not require .po file rename in installation
Diffstat (limited to 'includes/install.inc')
-rw-r--r-- | includes/install.inc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/includes/install.inc b/includes/install.inc index 1b7d7a796..5c53f3e80 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -1068,11 +1068,16 @@ function st($string, array $args = array(), array $options = array()) { if (!isset($locale_strings)) { $locale_strings = array(); if (isset($install_state['parameters']['profile']) && isset($install_state['parameters']['locale'])) { - $filename = 'profiles/' . $install_state['parameters']['profile'] . '/translations/' . $install_state['parameters']['locale'] . '.po'; - if (file_exists(DRUPAL_ROOT . '/' . $filename)) { + // If the given locale was selected, there should be at least one .po file + // with its name ending in {$install_state['parameters']['locale']}.po + // This might or might not be the entire filename. It is also possible + // that multiple files end with the same extension, even if unlikely. + $po_files = file_scan_directory('./profiles/' . $install_state['parameters']['profile'] . '/translations', '/'. $install_state['parameters']['locale'] .'\.po$/', array('recurse' => FALSE)); + if (count($po_files)) { require_once DRUPAL_ROOT . '/includes/locale.inc'; - $file = (object) array('uri' => $filename); - _locale_import_read_po('mem-store', $file); + foreach ($po_files as $po_file) { + _locale_import_read_po('mem-store', $po_file); + } $locale_strings = _locale_import_one_string('mem-report'); } } |