1 locale.test LocalePluralFormatTest::importPoFile($contents, array $options = array())

Imports a standalone .po file in a given language.

Parameters

$contents: Contents of the .po file to import.

$options: Additional options to pass to the translation import form.

File

core/modules/locale/tests/locale.test, line 673
Tests for locale.module.

Class

LocalePluralFormatTest
Tests plural index computation functionality.

Code

function importPoFile($contents, array $options = array()) {
  $name = backdrop_tempnam('temporary://', "po_") . '.po';
  file_put_contents($name, $contents);
  $options['files[file]'] = $name;
  $options['mode'] = LOCALE_IMPORT_OVERWRITE;
  $this->backdropPost('admin/config/regional/translate/import', $options, t('Import'));
  backdrop_unlink($name);
}