rejouage de #160, qui a été mis en suspens et a maintenant trop de conflits.
Co-authored-by: Mathieu Dupuy <mathieu.dupuy@gitguardian.com>
Reviewed-on: AFPy/python-docs-fr#170
Reviewed-by: Christophe Nanteuil <christophenan@noreply.localhost>
import polib
import pathlib
def check(file):
pofile = polib.pofile(file)
for entry in pofile:
if not entry.msgstr:
continue
if entry.msgid.endswith(" ::"):
entry.msgstr = entry.msgstr.rstrip(": \u202f\u00A0") + " ::"
if entry.msgid.endswith("::") and not entry.msgid.endswith(" ::"):
entry.msgstr = entry.msgstr.rstrip(": ,. \u202f\u00A0") + "\u00A0::"
pofile.save()
for file in pathlib.Path(".").glob("*.po"):
check(file)
for file in pathlib.Path(".").glob("*/*.po"):
check(file)