Yet another batch of : :: and no break spaces...#1148
Merged
JulienPalard merged 3 commits intopython:3.8from Feb 5, 2020
Merged
Yet another batch of : :: and no break spaces...#1148JulienPalard merged 3 commits intopython:3.8from
JulienPalard merged 3 commits intopython:3.8from
Conversation
via:
import polib
import pathlib
def check(file):
pofile = polib.pofile(file)
for entry in pofile:
if not entry.msgstr:
continue
if entry.msgid.endswith(" ::"):
continue
if entry.msgid.endswith("::") and entry.msgstr.endswith(" : ::"):
entry.msgstr = entry.msgstr.replace(" : ::", " ::")
pofile.save()
for file in pathlib.Path(".").glob("*.po"):
check(file)
for file in pathlib.Path(".").glob("*/*.po"):
check(file)
via:
import polib
import pathlib
def check(file):
pofile = polib.pofile(file)
for entry in pofile:
if not entry.msgstr:
continue
if entry.msgid.endswith(" ::"):
continue
if entry.msgid.endswith("::") and entry.msgstr.endswith(" : ::"):
entry.msgstr = entry.msgstr.replace(" : ::", " ::")
pofile.save()
for file in pathlib.Path(".").glob("*.po"):
check(file)
for file in pathlib.Path(".").glob("*/*.po"):
check(file)
via
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)
Seluj78
approved these changes
Feb 5, 2020
Contributor
|
We're not so far from having an automatic bot for this! What do you think about the automation of the process? |
Member
Author
|
@vpoulailleau yeah, go for it :] |
Contributor
|
@JulienPalard Why not 😉, but not right now, I don't have the time yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Can be easily diffed using:
In a nutshell it's a: