Commit 56bc655f authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #3050180 by alexpott, shaal, smaz: Cannot install Umami in Spanish

parent 8847936f
......@@ -524,6 +524,7 @@ protected function processBannerBlock(array $data, $langcode) {
'uuid' => $data['uuid'],
'info' => $data['info'],
'type' => $data['type'],
'langcode' => 'en',
'field_title' => [
'value' => $data['field_title'],
],
......@@ -556,6 +557,7 @@ protected function processDisclaimerBlock(array $data) {
'uuid' => $data['uuid'],
'info' => $data['info'],
'type' => $data['type'],
'langcode' => 'en',
'field_disclaimer' => [
'value' => $data['field_disclaimer'],
'format' => 'basic_html',
......@@ -585,6 +587,7 @@ protected function processFooterPromoBlock(array $data, $langcode) {
'uuid' => $data['uuid'],
'info' => $data['info'],
'type' => $data['type'],
'langcode' => 'en',
'field_title' => [
'value' => $data['field_title'],
],
......
<?php
namespace Drupal\Tests\demo_umami\Functional;
use Drupal\FunctionalTests\Installer\InstallerTestBase;
/**
* Tests the multilingual installer installing the Umami profile.
*
* @group Installer
*/
class UmamiMultilingualInstallTest extends InstallerTestBase {
/**
* {@inheritdoc}
*/
protected $profile = 'demo_umami';
/**
* {@inheritdoc}
*/
protected $langcode = 'es';
/**
* Ensures that Umami can be installed with Spanish as the default language.
*/
public function testUmami() {
$this->drupalGet('');
$this->assertSession()->pageTextContains('Quiche mediterráneo profundo');
}
/**
* {@inheritdoc}
*/
protected function setUpLanguage() {
// Place custom local translations in the translations directory to avoid
// getting translations from localize.drupal.org.
mkdir(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.es.po', $this->getPo('es'));
parent::setUpLanguage();
}
/**
* Returns the string for the test .po file.
*
* @param string $langcode
* The language code.
* @return string
* Contents for the test .po file.
*/
protected function getPo($langcode) {
return <<<ENDPO
msgid ""
msgstr ""
msgid "Save and continue"
msgstr "Save and continue $langcode"
msgid "Anonymous"
msgstr "Anonymous $langcode"
msgid "Language"
msgstr "Language $langcode"
#: Testing site name configuration during the installer.
msgid "Drupal"
msgstr "Drupal"
ENDPO;
}
}
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