Problem/Motivation
When using PoItem to export translation strings, the linebreak output differs between translated and untranslated strings.
Steps to reproduce
$untranslated = new PoItem();
$untranslated->setSource("");
// msgid ""
// msgstr ""
$untranslated->__toString():
$translated = new PoItem();
$translated->setSource("");
$translated->setTranslation("");
// msgid ""
// msgstr ""
//
$translated->__toString();
Proposed resolution
Append line break to singular untranslated string output for consistency with other cases.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3278481
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
gappleComment #4
andypostas a bug it needs fail.patch
Comment #5
gappleeasy 'nuff - I just edited the MR diff to only include the test in this patch file.
Comment #6
gappleComment #7
andypostComment #11
smustgrave commentedhaving a terrible time rebasing this lol
Comment #13
andypostUsed to run test for 11.x and cherry-picked commit from previous MR (thanks smustgrave for 9.5)
Comment #14
smustgrave commentedThink this looks good now
Comment #15
alexpottThere's so much odd code in this class...
Afaics
if (isset($this->translation[$i])) {must be true. I'm not even sure what that code is try to do... - maybe handle the case where one of the plural forms is not translated.Anyhow this fix is fine.
Comment #17
alexpottGoing to commit to 11.x only as I don;t see why po files should change in a patch release. It's not like this is causing any real bugs.
Committed be9783d and pushed to 11.x. Thanks!