Commit ea5de2e3 authored by webchick's avatar webchick

Issue #1392208 by Gábor Hojtsy, penyaskito, David_Rothstein: Fixed Impossible...

Issue #1392208 by Gábor Hojtsy, penyaskito, David_Rothstein: Fixed Impossible to install Drupal in a non-English language when following the provided instructions.
parent 428226c9
......@@ -1211,7 +1211,7 @@ function install_find_translations() {
*/
function install_find_translation_files($langcode = NULL) {
$directory = variable_get('locale_translate_file_directory', conf_path() . '/files/translations');
$files = file_scan_directory($directory, '!install\.' . (!empty($langcode) ? preg_quote($langcode, '!') : '[^\.]+') . '\.po$!', array('recurse' => FALSE));
$files = file_scan_directory($directory, '!drupal-\d+\.\d+\.' . (!empty($langcode) ? preg_quote($langcode, '!') : '[^\.]+') . '\.po$!', array('recurse' => FALSE));
return $files;
}
......
......@@ -694,10 +694,10 @@ function st($string, array $args = array(), array $options = array()) {
if (!isset($strings)) {
$strings = array();
if (isset($install_state['parameters']['langcode'])) {
// If the given langcode was selected, there should be at least one .po file
// with its name ending in install.{$install_state['parameters']['langcode']}.po
// If the given langcode was selected, there should be at least one .po
// file with its name in the pattern drupal-$version.$langcode.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.
// that multiple files end with the same suffix, even if unlikely.
$files = install_find_translation_files($install_state['parameters']['langcode']);
if (!empty($files)) {
// Register locale classes with the classloader. Locale module is not
......
......@@ -36,9 +36,9 @@ function testInstallerTranslationFiles() {
// Different translation files would be found depending on which language
// we are looking for.
$expected_translation_files = array(
NULL => array('install.hu.po', 'install.de.po'),
'de' => array('install.de.po'),
'hu' => array('install.hu.po'),
NULL => array('drupal-8.0.hu.po', 'drupal-8.0.de.po'),
'de' => array('drupal-8.0.de.po'),
'hu' => array('drupal-8.0.hu.po'),
'it' => array(),
);
......
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