File tree 2 files changed +57
-1
lines changed
2 files changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -1225,7 +1225,7 @@ msgid ""
1225
1225
"The ``long_description`` field is used by PyPI when you publish a package, "
1226
1226
"to build its project page."
1227
1227
msgstr ""
1228
- "PyPI utiliza el campo ``descripción larga `` cuando publica un paquete para "
1228
+ "PyPI utiliza el campo ``long_description `` cuando publica un paquete para "
1229
1229
"construir su página de proyecto."
1230
1230
1231
1231
#: ../Doc/distutils/setupscript.rst:621
Original file line number Diff line number Diff line change
1
+ import collections
2
+ import os
3
+ import glob
4
+
5
+ from pprint import pprint
6
+
7
+ import polib # fades
8
+
9
+ PO_DIR = os .path .abspath (
10
+ os .path .join (
11
+ os .path .dirname (__file__ ),
12
+ '..' ,
13
+ ))
14
+
15
+
16
+
17
+ DELIMITERS = ("``" , "*" )
18
+
19
+ def has_delimiters (x ):
20
+ for d in DELIMITERS :
21
+ if d in x :
22
+ return True
23
+ return False
24
+
25
+ def main ():
26
+ files_with_differences = collections .defaultdict (list )
27
+
28
+ for i , pofilename in enumerate (glob .glob (PO_DIR + '**/**/*.po' )):
29
+ po = polib .pofile (pofilename )
30
+ if po .percent_translated () < 85 :
31
+ continue
32
+
33
+ for entry in po :
34
+ words = []
35
+ wordsid = wordsstr = list ()
36
+
37
+ if has_delimiters (entry .msgid ):
38
+ wordsid = [word for word in entry .msgid .split () if has_delimiter (word )]
39
+
40
+ if has_delimiters (entry .msgstr ):
41
+ wordsstr = [word for word in entry .msgstr .split () if has_delimiter (word )]
42
+
43
+ if len (wordsid ) != len (wordsstr ):
44
+ key = pofilename .replace (PO_DIR , '' )
45
+ files_with_differences [key ].append ({
46
+ 'occurrences' : entry .occurrences ,
47
+ 'words' : {
48
+ 'original' : wordsid ,
49
+ 'translated' : wordsstr ,
50
+ },
51
+ })
52
+
53
+ return files_with_differences
54
+
55
+
56
+ pprint (main ())
You can’t perform that action at this time.
0 commit comments