Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes

This commit is contained in:
Pantheon Automation 2016-04-20 09:56:34 -07:00 committed by Greg Anderson
parent b11a755ba8
commit c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Access\ConfigTranslationFormAccess.
*/
namespace Drupal\config_translation\Access;
use Drupal\Core\Access\AccessResult;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Access\ConfigTranslationOverviewAccess.
*/
namespace Drupal\config_translation\Access;
use Drupal\Core\Language\LanguageManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\ConfigEntityMapper.
*/
namespace Drupal\config_translation;
use Drupal\Core\Config\ConfigFactoryInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\ConfigFieldMapper.
*/
namespace Drupal\config_translation;
use Drupal\Core\Config\Entity\ConfigEntityInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\ConfigMapperInterface.
*/
namespace Drupal\config_translation;
use Drupal\Core\Language\LanguageInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\ConfigMapperManager.
*/
namespace Drupal\config_translation;
use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\ConfigMapperManagerInterface.
*/
namespace Drupal\config_translation;
use Drupal\Component\Plugin\PluginManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\ConfigNamesMapper.
*/
namespace Drupal\config_translation;
use Drupal\Core\Config\ConfigFactoryInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Controller\ConfigTranslationBlockListBuilder.
*/
namespace Drupal\config_translation\Controller;
use Drupal\Core\Entity\EntityInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Controller\ConfigTranslationController.
*/
namespace Drupal\config_translation\Controller;
use Drupal\config_translation\ConfigMapperManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Controller\ConfigTranslationEntityListBuilder.
*/
namespace Drupal\config_translation\Controller;
use Drupal\Core\Entity\EntityInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Controller\ConfigTranslationEntityListBuilderInterface.
*/
namespace Drupal\config_translation\Controller;
use Drupal\Core\Entity\EntityListBuilderInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Controller\ConfigTranslationFieldListBuilder.
*/
namespace Drupal\config_translation\Controller;
use Drupal\Component\Utility\Unicode;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Controller\ConfigTranslationListController.
*/
namespace Drupal\config_translation\Controller;
use Drupal\config_translation\ConfigMapperManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Controller\ConfigTranslationMapperList.
*/
namespace Drupal\config_translation\Controller;
use Drupal\config_translation\ConfigMapperInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Form\ConfigTranslationAddForm.
*/
namespace Drupal\config_translation\Form;
use Drupal\Core\Form\FormStateInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Form\ConfigTranslationDeleteForm.
*/
namespace Drupal\config_translation\Form;
use Drupal\config_translation\ConfigMapperManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Form\ConfigTranslationEditForm.
*/
namespace Drupal\config_translation\Form;
use Drupal\Core\Form\FormStateInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Form\ConfigTranslationFormBase.
*/
namespace Drupal\config_translation\Form;
use Drupal\config_translation\ConfigMapperManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\FormElement\DateFormat.
*/
namespace Drupal\config_translation\FormElement;
use Drupal\Core\Language\LanguageInterface;
@ -20,7 +15,7 @@ class DateFormat extends FormElementBase {
public function getTranslationElement(LanguageInterface $translation_language, $source_config, $translation_config) {
/** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */
$date_formatter = \Drupal::service('date.formatter');
$description = $this->t('A user-defined date format. See the <a href=":url">PHP manual</a> for available options.', array(':url' => 'http://php.net/manual/function.date.php'));
$description = $this->t('A user-defined date format. See the <a href="http://php.net/manual/function.date.php">PHP manual</a> for available options.');
$format = $this->t('Displayed as %date_format', array('%date_format' => $date_formatter->format(REQUEST_TIME, 'custom', $translation_config)));
return [

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\FormElement\ElementInterface.
*/
namespace Drupal\config_translation\FormElement;
use Drupal\Core\Config\Config;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\FormElement\FormElementBase.
*/
namespace Drupal\config_translation\FormElement;
use Drupal\Core\Config\Config;
@ -101,7 +96,8 @@ abstract class FormElementBase implements ElementInterface {
return array(
'#type' => 'item',
'#title' => $this->t('@label <span class="visually-hidden">(@source_language)</span>', array(
'@label' => $this->definition->getLabel(),
// Labels originate from configuration schema and are translatable.
'@label' => $this->t($this->definition->getLabel()),
'@source_language' => $source_language->getName(),
)),
'#markup' => $value,
@ -163,7 +159,8 @@ abstract class FormElementBase implements ElementInterface {
// Add basic properties that apply to all form elements.
return array(
'#title' => $this->t('@label <span class="visually-hidden">(@source_language)</span>', array(
'@label' => $this->definition['label'],
// Labels originate from configuration schema and are translatable.
'@label' => $this->t($this->definition->getLabel()),
'@source_language' => $translation_language->getName(),
)),
'#default_value' => $translation_config,

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\FormElement\ListElement.
*/
namespace Drupal\config_translation\FormElement;
use Drupal\Core\Config\Config;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\FormElement\PluralVariants.
*/
namespace Drupal\config_translation\FormElement;
use Drupal\Component\Utility\SafeMarkup;
@ -26,6 +21,7 @@ class PluralVariants extends FormElementBase {
$element = array(
'#type' => 'fieldset',
'#title' => SafeMarkup::format('@label <span class="visually-hidden">(@source_language)</span>', array(
// Labels originate from configuration schema and are translatable.
'@label' => $this->t($this->definition->getLabel()),
'@source_language' => $source_language->getName(),
)),
@ -54,6 +50,7 @@ class PluralVariants extends FormElementBase {
$element = array(
'#type' => 'fieldset',
'#title' => SafeMarkup::format('@label <span class="visually-hidden">(@translation_language)</span>', array(
// Labels originate from configuration schema and are translatable.
'@label' => $this->t($this->definition->getLabel()),
'@translation_language' => $translation_language->getName(),
)),

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\FormElement\TextFormat.
*/
namespace Drupal\config_translation\FormElement;
use Drupal\Core\Language\LanguageInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\FormElement\Textarea.
*/
namespace Drupal\config_translation\FormElement;
use Drupal\Core\Language\LanguageInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\FormElement\Textfield.
*/
namespace Drupal\config_translation\FormElement;
use Drupal\Core\Language\LanguageInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Plugin\Derivative\ConfigTranslationContextualLinks.
*/
namespace Drupal\config_translation\Plugin\Derivative;
use Drupal\Component\Plugin\Derivative\DeriverBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Plugin\Derivative\ConfigTranslationLocalTasks.
*/
namespace Drupal\config_translation\Plugin\Derivative;
use Drupal\config_translation\ConfigMapperManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Plugin\Menu\ContextualLink\ConfigTranslationContextualLink.
*/
namespace Drupal\config_translation\Plugin\Menu\ContextualLink;
use Drupal\Component\Utility\Unicode;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Plugin\Menu\LocalTask\ConfigTranslationLocalTask.
*/
namespace Drupal\config_translation\Plugin\Menu\LocalTask;
use Drupal\Component\Utility\Unicode;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Routing\RouteSubscriber.
*/
namespace Drupal\config_translation\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Tests\ConfigTranslationDateFormatUiTest.
*/
namespace Drupal\config_translation\Tests;
use Drupal\language\Entity\ConfigurableLanguage;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Tests\ConfigTranslationFormTest.
*/
namespace Drupal\config_translation\Tests;
use Drupal\language\Entity\ConfigurableLanguage;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Tests\ConfigTranslationInstallTest.
*/
namespace Drupal\config_translation\Tests;
use Drupal\simpletest\InstallerTestBase;

View file

@ -1,16 +1,17 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Tests\ConfigTranslationListUiTest.
*/
namespace Drupal\config_translation\Tests;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Component\Utility\Unicode;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\WebTestBase;
use Drupal\shortcut\Entity\ShortcutSet;
use Drupal\contact\Entity\ContactForm;
use Drupal\filter\Entity\FilterFormat;
use Drupal\taxonomy\Entity\Vocabulary;
/**
* Visit all lists.
@ -160,11 +161,11 @@ class ConfigTranslationListUiTest extends WebTestBase {
protected function doVocabularyListTest() {
// Create a test vocabulary to decouple looking for translate operations
// link so this does not test more than necessary.
$vocabulary = entity_create('taxonomy_vocabulary', array(
$vocabulary = Vocabulary::create([
'name' => $this->randomMachineName(),
'description' => $this->randomMachineName(),
'vid' => Unicode::strtolower($this->randomMachineName()),
));
]);
$vocabulary->save();
// Get the Taxonomy listing.
@ -185,7 +186,7 @@ class ConfigTranslationListUiTest extends WebTestBase {
public function doCustomContentTypeListTest() {
// Create a test custom block type to decouple looking for translate
// operations link so this does not test more than necessary.
$block_content_type = entity_create('block_content_type', array(
$block_content_type = BlockContentType::create(array(
'id' => Unicode::strtolower($this->randomMachineName(16)),
'label' => $this->randomMachineName(),
'revision' => FALSE
@ -210,10 +211,10 @@ class ConfigTranslationListUiTest extends WebTestBase {
public function doContactFormsListTest() {
// Create a test contact form to decouple looking for translate operations
// link so this does not test more than necessary.
$contact_form = entity_create('contact_form', array(
$contact_form = ContactForm::create([
'id' => Unicode::strtolower($this->randomMachineName(16)),
'label' => $this->randomMachineName(),
));
]);
$contact_form->save();
// Get the contact form listing.
@ -257,7 +258,7 @@ class ConfigTranslationListUiTest extends WebTestBase {
public function doFormatsListTest() {
// Create a test format to decouple looking for translate operations
// link so this does not test more than necessary.
$filter_format = entity_create('filter_format', array(
$filter_format = FilterFormat::create(array(
'format' => Unicode::strtolower($this->randomMachineName(16)),
'name' => $this->randomMachineName(),
));
@ -281,7 +282,7 @@ class ConfigTranslationListUiTest extends WebTestBase {
public function doShortcutListTest() {
// Create a test shortcut to decouple looking for translate operations
// link so this does not test more than necessary.
$shortcut = entity_create('shortcut_set', array(
$shortcut = ShortcutSet::create(array(
'id' => Unicode::strtolower($this->randomMachineName(16)),
'label' => $this->randomString(),
));
@ -391,20 +392,20 @@ class ConfigTranslationListUiTest extends WebTestBase {
));
// Create a block content type.
$block_content_type = entity_create('block_content_type', array(
$block_content_type = BlockContentType::create(array(
'id' => 'basic',
'label' => 'Basic',
'revision' => FALSE
));
$block_content_type->save();
$field = entity_create('field_config', array(
$field = FieldConfig::create([
// The field storage is guaranteed to exist because it is supplied by the
// block_content module.
'field_storage' => FieldStorageConfig::loadByName('block_content', 'body'),
'bundle' => $block_content_type->id(),
'label' => 'Body',
'settings' => array('display_summary' => FALSE),
));
]);
$field->save();
// Look at a few fields on a few entity types.

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Tests\ConfigTranslationOverviewTest.
*/
namespace Drupal\config_translation\Tests;
use Drupal\Component\Utility\Html;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Tests\ConfigTranslationUiTest.
*/
namespace Drupal\config_translation\Tests;
use Drupal\Component\Serialization\Json;
@ -128,10 +123,12 @@ class ConfigTranslationUiTest extends WebTestBase {
public function testSiteInformationTranslationUi() {
$this->drupalLogin($this->adminUser);
$site_name = 'Site name for testing configuration translation';
$site_name = 'Name of the site for testing configuration translation';
$site_slogan = 'Site slogan for testing configuration translation';
$site_name_label = 'Site name';
$fr_site_name = 'Nom du site pour tester la configuration traduction';
$fr_site_slogan = 'Slogan du site pour tester la traduction de configuration';
$fr_site_name_label = 'Libellé du champ "Nom du site"';
$translation_base_url = 'admin/config/system/site-information/translate';
// Set site name and slogan for default language.
@ -189,6 +186,37 @@ class ConfigTranslationUiTest extends WebTestBase {
$this->drupalGet("fr/$translation_base_url/fr/edit");
$this->assertText($site_name);
$this->assertText($site_slogan);
// Translate 'Site name' label in French.
$search = array(
'string' => $site_name_label,
'langcode' => 'fr',
'translation' => 'untranslated',
);
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$textarea = current($this->xpath('//textarea'));
$lid = (string) $textarea[0]['name'];
$edit = array(
$lid => $fr_site_name_label,
);
$this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
// Ensure that the label is in French (and not in English).
$this->drupalGet("fr/$translation_base_url/fr/edit");
$this->assertText($fr_site_name_label);
$this->assertNoText($site_name_label);
// Ensure that the label is also in French (and not in English)
// when editing another language with the interface in French.
$this->drupalGet("fr/$translation_base_url/ta/edit");
$this->assertText($fr_site_name_label);
$this->assertNoText($site_name_label);
// Ensure that the label is not translated when the interface is in English.
$this->drupalGet("$translation_base_url/fr/edit");
$this->assertText($site_name_label);
$this->assertNoText($fr_site_name_label);
}
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Tests\ConfigTranslationUiThemeTest.
*/
namespace Drupal\config_translation\Tests;
use Drupal\language\Entity\ConfigurableLanguage;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\config_translation\Tests\ConfigTranslationViewListUiTest.
*/
namespace Drupal\config_translation\Tests;
use Drupal\views_ui\Tests\UITestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\config_translation\Unit\ConfigEntityMapperTest.
*/
namespace Drupal\Tests\config_translation\Unit;
use Drupal\config_translation\ConfigEntityMapper;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\config_translation\Unit\ConfigFieldMapperTest.
*/
namespace Drupal\Tests\config_translation\Unit;
use Drupal\config_translation\ConfigFieldMapper;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\config_translation\Unit\ConfigMapperManagerTest.
*/
namespace Drupal\Tests\config_translation\Unit;
use Drupal\config_translation\ConfigMapperManager;