getCustomOverwritePoFile example

// The database should now contain 6 customized strings (two imported     // strings are not translated).     $count = Database::getConnection()->select('locales_target')
      ->condition('customized', 1)
      ->countQuery()
      ->execute()
      ->fetchField();
    $this->assertEquals(6, $count, 'Customized translations successfully imported.');

    // Try importing a .po file with overriding strings, and ensure existing     // customized strings are kept.     $this->importPoFile($this->getCustomOverwritePoFile()[
      'langcode' => 'fr',
      'overwrite_options[not_customized]' => TRUE,
      'overwrite_options[customized]' => FALSE,
    ]);

    // The import should have created 1 string.     $this->assertSession()->pageTextContains("One translation file imported. 1 translations were added, 0 translations were updated and 0 translations were removed.");
    // Ensure string wasn't overwritten.     $search = [
      'string' => 'januari',
      'langcode' => 'fr',
      
Home | Imprint | This part of the site doesn't use cookies.