$ git clone https://github.com/python/python-docs-fr
$ cd python-docs-fr
$ git show c19994718d42e005482e15a8aebbd486249373b3:library/random.po > remote.po
$ git show fecaae68a857755139126c7444e43bbb48d94ddd:library/random.po > local.po
$ git show 3db1d961d637c47bb37e2a268916efdc936b0846:library/random.po > base.po
# Context, in remote the msgid got translated while in local the msgid got reworded, see:
$ grep -B1 -A5 'must be a sequence' base.po
msgid ""
"In the future, the *population* must be a sequence. Instances of :class:"
"`set` are no longer supported. The set must first be converted to a :class:"
"`list` or :class:`tuple`, preferably in a deterministic order so that the "
"sample is reproducible."
msgstr ""
$ grep -B1 -A3 'must be a sequence' local.po
msgid ""
"The *population* must be a sequence. Automatic conversion of sets to lists "
"is longer supported."
msgstr ""
$ grep -B2 -A5 'must be a sequence' remote.po
#: library/random.rst:260
msgid ""
"In the future, the *population* must be a sequence. Instances of :class:"
"`set` are no longer supported. The set must first be converted to a :class:"
"`list` or :class:`tuple`, preferably in a deterministic order so that the "
"sample is reproducible."
msgstr ""
"À l’avenir, la *population* devra être une séquence. Les instances de :"
After a merge using the script from https://stackoverflow.com/a/68799310/334451:
$ bash mikko-merge.sh local.po base.po remote.po random.po
I get the msgid duplicated:
$ grep -C2 'must be a sequence' local.po
#: library/random.rst:260
msgid "In the future, the *population* must be a sequence. Instances of :class:`set` are no longer supported. The set must first be converted to a :class:`list` or :class:`tuple`, preferably in a deterministic order so that the sample is reproducible."
msgstr "À l’avenir, la *population* devra être une séquence. Les instances de :class:`set` ne sont plus prises en charge. Le *set* doit d’abord être converti en une :class:`list` ou :class:`tuple`, de préférence dans un ordre déterministe de telle sorte que l’échantillon soit reproductible."
--
#: library/random.rst:259
msgid "The *population* must be a sequence. Automatic conversion of sets to lists is longer supported."
msgstr ""
Also the wrapping is lost, which I personally don't like because all
translators may not wrap identically (it's not possible to ask
everyone to wrap exactly identically as they don't all use the same
tools, or the same version of said tools, and we've seen wrapping
algorithm change, it this year for gettext wrapping, impacting poedit
too IIRC), so loosing the wrapping often mean introducing useless
changes in the log, making proofreading harder (I mean, in git log and
pull requests, yes, we do use pull requests to proofread
translations...).
while using msg3way I see a conflict, as expected, so the human being
merging have a chance to keep the msgstr if it's worth, flag fuzzy,
remove it, whatever:
$ po3way local.po base.po remote.po | grep -B3 -A9 'must be a sequence'
<<<<<<< /tmp/tmpavedav7m/local.po
#: library/random.rst:259
msgid ""
"The *population* must be a sequence. Automatic conversion of sets to lists "
"is longer supported."
msgstr ""
=======
#: library/random.rst:260
msgid ""
"In the future, the *population* must be a sequence. Instances of :class:"
"`set` are no longer supported. The set must first be converted to a :class:"
"`list` or :class:`tuple`, preferably in a deterministic order so that the "
"sample is reproducible."
msgstr ""
"À l’avenir, la *population* devra être une séquence. Les instances de :"
"class:`set` ne sont plus prises en charge. Le *set* doit d’abord être "
"converti en une :class:`list` ou :class:`tuple`, de préférence dans un ordre "
"déterministe de telle sorte que l’échantillon soit reproductible."
>>>>>>> /tmp/tmpavedav7m/remote.po