getPoFileWithConfig example

// Check for the source strings we are going to translate. Adding the     // custom language should have made the process to export configuration     // strings to interface translation executed.     $locale_storage = $this->container->get('locale.storage');
    foreach ($config_strings as $config_string) {
      $string = $locale_storage->findString(['source' => $config_string[0], 'context' => '', 'type' => 'configuration']);
      $this->assertNotEmpty($string, 'Configuration strings have been created upon installation.');
    }

    // Import a .po file to translate.     $this->importPoFile($this->getPoFileWithConfig()[
      'langcode' => $langcode,
    ]);

    // Translations got recorded in the interface translation system.     foreach ($config_strings as $config_string) {
      $search = [
        'string' => $config_string[0],
        'langcode' => $langcode,
        'translation' => 'all',
      ];
      $this->drupalGet('admin/config/regional/translate');
      
Home | Imprint | This part of the site doesn't use cookies.