Commit b2b2a444 authored by alexpott's avatar alexpott

Issue #2029505 by penyaskito, YesCT, Gábor Hojtsy: Fixed Exporting...

Issue #2029505 by penyaskito, YesCT, Gábor Hojtsy: Fixed Exporting translations does not correctly generate empty strings.
parent 486f5d03
......@@ -256,8 +256,8 @@ private function formatPlural() {
*/
private function formatSingular() {
$output = '';
$output .= 'msgid '. $this->formatString($this->_source);
$output .= 'msgstr '. (isset($this->_translation) ? $this->formatString($this->_translation) : '');
$output .= 'msgid ' . $this->formatString($this->_source);
$output .= 'msgstr ' . (isset($this->_translation) ? $this->formatString($this->_translation) : '""');
return $output;
}
......
......@@ -113,8 +113,8 @@ function testExportTranslation() {
$this->assertRaw('# French translation of Drupal', t('Exported French translation file with only untranslated strings.'));
// Ensure no customized translations exist in the file.
$this->assertNoRaw('msgstr "janvier"', t('French custom translation not present in exported file.'));
// Ensure the untranslated strings exist in the file.
$this->assertRaw('msgid "February"', t('Untranslated string present in exported file.'));
// Ensure the untranslated strings exist in the file, and with right quotes.
$this->assertRaw($this->getUntranslatedString(), t('Empty string present in exported file.'));
}
/**
......@@ -165,6 +165,19 @@ function getCustomPoFile() {
msgid "January"
msgstr "janvier"
EOF;
}
/**
* Returns a .po file fragment with an untranslated string.
*
* @return string
* A .po file fragment with an untranslated string.
*/
function getUntranslatedString() {
return <<< EOF
msgid "February"
msgstr ""
EOF;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment