equal
deleted
inserted
replaced
66 w.ImportMessages(messages) |
66 w.ImportMessages(messages) |
67 |
67 |
68 with open(fname, 'w') as POT_file: |
68 with open(fname, 'w') as POT_file: |
69 w.write(POT_file) |
69 w.write(POT_file) |
70 |
70 |
|
71 def GetPoFiles(dirpath): |
|
72 po_files = [fname for fname in os.listdir(dirpath) if fname.endswith(".po")] |
|
73 po_files.sort() |
|
74 return po_files |
|
75 |
71 def ReadTranslations(dirpath): |
76 def ReadTranslations(dirpath): |
72 """ Read all PO files from a directory and return a list of (langcode, translation_dict) tuples """ |
77 """ Read all PO files from a directory and return a list of (langcode, translation_dict) tuples """ |
73 |
78 |
74 po_files = [fname for fname in os.listdir(dirpath) if fname.endswith(".po")] |
79 po_files = GetPoFiles(dirpath) |
75 po_files.sort() |
|
76 |
80 |
77 translations = [] |
81 translations = [] |
78 for po_fname in po_files: |
82 for po_fname in po_files: |
79 r = POReader() |
83 r = POReader() |
80 with open(os.path.join(dirpath, po_fname), 'r') as PO_file: |
84 with open(os.path.join(dirpath, po_fname), 'r') as PO_file: |