From 3f926260874d09109f225c26bec7fb65d97f2da0 Mon Sep 17 00:00:00 2001 From: webchick Date: Sat, 18 Aug 2012 12:42:31 +0200 Subject: [PATCH] =?UTF-8?q?Issue=20#1733746=20by=20penyaskito,=20sxnc,=20j?= =?UTF-8?q?sbalsera,=20G=C3=A1bor=20Hojtsy:=20Fixed=20D8=20installer=20is?= =?UTF-8?q?=20broken=20if=20selecting=20a=20non-English=20language=20on=20?= =?UTF-8?q?installation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/includes/install.inc | 3 +++ core/lib/Drupal/Component/Gettext/PoMemoryWriter.php | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/includes/install.inc b/core/includes/install.inc index 4c9c60c273c..f0c329b268a 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -700,6 +700,9 @@ function st($string, array $args = array(), array $options = array()) { // that multiple files end with the same extension, 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 + // yet enabled at this stage, so this is not happening automatically. + drupal_classloader_register('locale', drupal_get_path('module', 'locale')); $strings = Gettext::filesToArray($install_state['parameters']['langcode'], $files); } } diff --git a/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php b/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php index e304451314b..11c53613546 100644 --- a/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php +++ b/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php @@ -34,11 +34,12 @@ class PoMemoryWriter implements PoWriterInterface { * Implements Drupal\Component\Gettext\PoWriterInterface::writeItem(). */ public function writeItem(PoItem $item) { - if (is_array($item->source)) { - $item->source = implode(LOCALE_PLURAL_DELIMITER, $item->source); - $item->translation = implode(LOCALE_PLURAL_DELIMITER, $item->translation); + if (is_array($item->getSource())) { + $item->setSource(implode(LOCALE_PLURAL_DELIMITER, $item->getSource())); + $item->setTranslation(implode(LOCALE_PLURAL_DELIMITER, $item->getTranslation())); } - $this->_items[isset($item->context) ? $item->context : ''][$item->source] = $item->translation; + $context = $item->getContext(); + $this->_items[$context != NULL ? $context : ''][$item->getSource()] = $item->getTranslation(); } /**