diff --git a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php index d5a12256629b24838e6035067810d28a572e6d4e..cdcb0c06aef0e07ab9fe31641f4713b3bbd9fed9 100644 --- a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php +++ b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php @@ -155,7 +155,6 @@ function getHeader() { */ function setHeader(PoHeader $header) { $this->_header = $header; - $config = \Drupal::config('locale.settings'); $locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array(); // Check for options. @@ -267,7 +266,7 @@ private function importString(PoItem $item) { // No such source string in the database yet. $string = \Drupal::service('locale.storage')->createString(array('source' => $source, 'context' => $context)) ->save(); - $target = \Drupal::service('locale.storage')->createTranslation(array( + \Drupal::service('locale.storage')->createTranslation(array( 'lid' => $string->getId(), 'language' => $this->_langcode, 'translation' => $translation, diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php index 2b53ff3930879b37ede2b3b9b16aec6def3f6e1f..87febe49f26268b6f14e858181ff2dad7493bc6d 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php @@ -63,8 +63,6 @@ function testMachineNameLTR() { * Test if a content type can be set to multilingual and language is present. */ function testContentTypeLanguageConfiguration() { - global $base_url; - $type1 = $this->drupalCreateContentType(); $type2 = $this->drupalCreateContentType(); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php index 8cd217b35860b3087a4bf37c7b549ce0930dab56..13b7bc2a8885a62700299b07dbf933028cb0cbe7 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php @@ -53,7 +53,7 @@ function testStandalonePoFile() { $this->importPoFile($this->getPoFile(), array( 'langcode' => 'fr', )); - $config = \Drupal::config('locale.settings'); + \Drupal::config('locale.settings'); // The import should automatically create the corresponding language. $this->assertRaw(t('The language %language has been created.', array('%language' => 'French')), 'The language has been automatically created.'); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php index 931212d5c98422bb81f8e35e1ef5989bef89a361..62aba310e380e5e99555e05b0e65676d56465877 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php @@ -41,8 +41,6 @@ function setUp() { * Test if a language can be associated with a path alias. */ function testPathLanguageConfiguration() { - global $base_url; - // User to add and remove language. $admin_user = $this->drupalCreateUser(array('administer languages', 'create page content', 'administer url aliases', 'create url aliases', 'access administration pages')); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php index 2a59408d64b2ae5f4a47c55bf9138b958904f92f..59993f03b2de822b58aae464f64573a236824ce0 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php @@ -96,7 +96,7 @@ function testStringCRUDAPI() { // Create some translations and then delete string and all of its translations. $lid = $source->lid; - $translations = $this->createAllTranslations($source); + $this->createAllTranslations($source); $search = $this->storage->getTranslations(array('lid' => $source->lid)); $this->assertEqual(count($search), 3, 'Created and retrieved all translations for our source string.'); @@ -144,7 +144,7 @@ function testStringSearchAPI() { // Not customized translations. $translate1 = $this->createAllTranslations($source1); // Customized translations. - $translate2 = $this->createAllTranslations($source2, array('customized' => LOCALE_CUSTOMIZED)); + $this->createAllTranslations($source2, array('customized' => LOCALE_CUSTOMIZED)); // Try quick search function with different field combinations. $langcode = 'es'; $found = $this->storage->findTranslation(array('language' => $langcode, 'source' => $source1->source, 'context' => $source1->context)); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php index 06b6ed42ec00fbc8da1682d64f186f1da24751e1..d02f76388c25be7458bf68e1448884f7659fbb8f 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php @@ -46,8 +46,6 @@ function testEnglishTranslation() { * Adds a language and tests string translation by users with the appropriate permissions. */ function testStringTranslation() { - global $base_url; - // User to add and remove language. $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages')); // User to translate and delete string. @@ -56,9 +54,6 @@ function testStringTranslation() { $langcode = 'xx'; // The English name for the language. This will be translated. $name = $this->randomName(16); - // This is the language indicator on the translation search screen for - // untranslated strings. - $language_indicator = "<em class=\"locale-untranslated\">$langcode</em> "; // This will be the translation of $name. $translation = $this->randomName(16); $translation_to_en = $this->randomName(16); @@ -94,9 +89,7 @@ function testStringTranslation() { // We save the lid from the path. $textarea = current($this->xpath('//textarea')); $lid = (string) $textarea[0]['name']; - $edit = array( - $lid => $this->randomName(), - ); + // No t() here, it's surely not translated yet. $this->assertText($name, 'name found on edit screen.'); $this->assertNoOption('edit-langcode', 'en', 'No way to translate the string to English.'); @@ -276,8 +269,6 @@ function testJavaScriptTranslation() { * Tests the validation of the translation input. */ function testStringValidation() { - global $base_url; - // User to add language and strings. $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'translate interface')); $this->drupalLogin($admin_user); @@ -316,7 +307,7 @@ function testStringValidation() { $textarea = current($this->xpath('//textarea')); $lid = (string) $textarea[0]['name']; - foreach ($bad_translations as $key => $translation) { + foreach ($bad_translations as $translation) { $edit = array( $lid => $translation, ); @@ -332,8 +323,6 @@ function testStringValidation() { * Tests translation search form. */ function testStringSearch() { - global $base_url; - // User to add and remove language. $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages')); // User to translate and delete string. @@ -343,9 +332,6 @@ function testStringSearch() { $langcode = 'xx'; // The English name for the language. This will be translated. $name = $this->randomName(16); - // This is the language indicator on the translation search screen for - // untranslated strings. - $language_indicator = "<em class=\"locale-untranslated\">$langcode</em> "; // This will be the translation of $name. $translation = $this->randomName(16); @@ -510,7 +496,7 @@ function testUICustomizedStrings(){ ); $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter')); - $source = $this->assertText($translation->getString(), 'Translation is found in search result.'); + $this->assertText($translation->getString(), 'Translation is found in search result.'); // Submit the translations without changing the translation. $textarea = current($this->xpath('//textarea')); @@ -528,7 +514,7 @@ function testUICustomizedStrings(){ 'customized' => '0', ); $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter')); - $source = $this->assertText($string->getString(), 'Translation is not marked as customized.'); + $this->assertText($string->getString(), 'Translation is not marked as customized.'); // Submit the translations with a new translation. $textarea = current($this->xpath('//textarea')); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php index 3d20f6d165cb306be710f659b92f6aa74127a9f7..62fa90c48eef8912df9419751e3878f000b69449 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php @@ -65,7 +65,7 @@ function testUpdateProjects() { */ function testUpdateProjectsHidden() { module_load_include('compare.inc', 'locale'); - $config = \Drupal::config('locale.settings'); + \Drupal::config('locale.settings'); // Make the test modules look like a normal custom module. \Drupal::state()->set('locale.test_system_info_alter', TRUE);