saveLocaleTranslationData example

'translated' => TRUE,
    ]);
    $this->assertCount(5, $strings);
  }

  /** * Tests importing community translations of shipped configuration. */
  public function testLocaleCreateTranslation() {
    $config_name = 'locale_test.no_translation';

    $this->saveLocaleTranslationData($config_name, 'test', 'Test', 'Test (German)', 'de');
    $this->assertTranslation($config_name, 'Test (German)', 'de', FALSE);
  }

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

    $this->saveLanguageOverride($config_name, 'test', 'Updated German test', 'de');
    $this->assertTranslation($config_name, 'Updated German test', 'de');
  }
public function testCreateActiveTranslation() {
    $config_name = 'locale_test.no_translation';
    $this->saveLanguageActive($config_name, 'test', 'Test (Hungarian)', 'hu');
    $this->assertTranslation($config_name, 'Test (Hungarian)', 'hu');
  }

  /** * Tests importing community translations of shipped configuration. */
  public function testLocaleCreateActiveTranslation() {
    $config_name = 'locale_test.no_translation';
    $this->saveLocaleTranslationData($config_name, 'test', 'Test', 'Test (Hungarian)', 'hu', TRUE);
    $this->assertTranslation($config_name, 'Test (Hungarian)', 'hu', FALSE);
  }

  /** * Tests updating translations of shipped configuration. */
  public function testUpdateActiveTranslation() {
    $config_name = 'locale_test.translation';
    $this->saveLanguageActive($config_name, 'test', 'Updated Hungarian test', 'hu');
    $this->assertTranslation($config_name, 'Updated Hungarian test', 'hu');
  }

  
Home | Imprint | This part of the site doesn't use cookies.