deleteLocaleTranslationData example

    // the source value and mark it as customized to prevent the deletion being     // reverted by importing community translations.     $this->assertTranslation($config_name, 'English test', 'de');
  }

  /** * Tests deleting community translations of shipped configuration. */
  public function testLocaleDeleteTranslation() {
    $config_name = 'locale_test.translation';

    $this->deleteLocaleTranslationData($config_name, 'test', 'English test', 'de');
    $this->assertNoTranslation($config_name, 'de');
  }

  /** * Sets up a configuration string without a translation. * * The actual configuration is already available by installing locale_test * module, as it is done in LocaleConfigSubscriberTest::setUp(). This sets up * the necessary source string and verifies that everything is as expected to * avoid false positives. * * @param string $config_name * The configuration name. * @param string $key * The configuration key. * @param string $source * The source string. * @param string $langcode * The language code. */
$config_name = 'locale_test.translation';
    $this->configFactory->getEditable($config_name)->delete();
    // Deleting active configuration should not change the locale translation.     $this->assertTranslation($config_name, 'Hungarian test', 'hu', FALSE);
  }

  /** * Tests deleting community translations of shipped configuration. */
  public function testLocaleDeleteActiveTranslation() {
    $config_name = 'locale_test.translation';
    $this->deleteLocaleTranslationData($config_name, 'test', 'English test', 'hu');
    // Deleting the locale translation should not change active config.     $this->assertEquals('Hungarian test', $this->configFactory->getEditable($config_name)->get('test'));
  }

  /** * Tests that adding English creates a translation override. */
  public function testEnglish() {
    $config_name = 'locale_test.translation';
    ConfigurableLanguage::createFromLangcode('en')->save();
    // Adding a language on the UI would normally call updateConfigTranslations.
Home | Imprint | This part of the site doesn't use cookies.