diff --git a/distutils/setupscript.po b/distutils/setupscript.po index 7d9633a99a..b91730bb01 100644 --- a/distutils/setupscript.po +++ b/distutils/setupscript.po @@ -1225,7 +1225,7 @@ msgid "" "The ``long_description`` field is used by PyPI when you publish a package, " "to build its project page." msgstr "" -"PyPI utiliza el campo ``descripción larga`` cuando publica un paquete para " +"PyPI utiliza el campo ``long_description`` cuando publica un paquete para " "construir su pÔgina de proyecto." #: ../Doc/distutils/setupscript.rst:621 diff --git a/scripts/format_differences.py b/scripts/format_differences.py new file mode 100644 index 0000000000..06a763743f --- /dev/null +++ b/scripts/format_differences.py @@ -0,0 +1,56 @@ +import collections +import os +import glob + +from pprint import pprint + +import polib # fades + +PO_DIR = os.path.abspath( + os.path.join( + os.path.dirname(__file__), + '..', + )) + + + +DELIMITERS = ("``", "*") + +def has_delimiters(x): + for d in DELIMITERS: + if d in x: + return True + return False + +def main(): + files_with_differences = collections.defaultdict(list) + + for i, pofilename in enumerate(glob.glob(PO_DIR + '**/**/*.po')): + po = polib.pofile(pofilename) + if po.percent_translated() < 85: + continue + + for entry in po: + words = [] + wordsid = wordsstr = list() + + if has_delimiters(entry.msgid): + wordsid = [word for word in entry.msgid.split() if has_delimiter(word)] + + if has_delimiters(entry.msgstr): + wordsstr = [word for word in entry.msgstr.split() if has_delimiter(word)] + + if len(wordsid) != len(wordsstr): + key = pofilename.replace(PO_DIR, '') + files_with_differences[key].append({ + 'occurrences': entry.occurrences, + 'words': { + 'original': wordsid, + 'translated': wordsstr, + }, + }) + + return files_with_differences + + +pprint(main())