Repository navigation
Add Merge::DISABLED_OURS to keep a re-added string active - #319
Conversation
|
I'm not sure about this. |
mergeWith() copied the other side's disabled flag, so a string that was used again stayed obsolete after merging a scan with a PO and its translation never reached the .mo.
e4e8667 to
eb11e9b
Compare
|
Good point. In eb11e9b the obsolete state follows One catch: |
|
But there may be other cases in which we are mergin two PO files, and both sides can enable or disable comments. |
|
Makes sense, I dropped the "both sides" rule. In 57163ae:
I added only an |
|
Great, thank you! |
|
Done in abd08cf. |
|
Perfect. Thank you! |
When a string comes back into the code after it was removed, scanning and loading the existing PO keeps it obsolete, so its translation never reaches the .mo:
msgmerge fr.po messages.potbrings it back active with "Obsolète".This adds an opt-in
Merge::DISABLED_OURS: keep whether$translation1is disabled instead of taking it from$translation2. Nothing changes without it,SCAN_AND_LOADincluded. For the case above, useMerge::SCAN_AND_LOAD | Merge::DISABLED_OURS(testReaddedStringIsNoLongerObsolete).testDisabledStateComesFromTheOtherSideByDefaultchecks that the default is unchanged. README lists the flag. phpunit (112 tests) and phpstan pass.