808 ("TRANSLATIONS", |
808 ("TRANSLATIONS", |
809 [prefix + lang for lang in langs])) |
809 [prefix + lang for lang in langs])) |
810 |
810 |
811 dir, name = os.path.split(pfile) |
811 dir, name = os.path.split(pfile) |
812 outFile = os.path.join(dir, os.path.dirname(langs[0]), name) |
812 outFile = os.path.join(dir, os.path.dirname(langs[0]), name) |
|
813 outDir = os.path.dirname(outFile) |
|
814 if not os.path.exists(outDir): |
|
815 os.makedirs(outDir) |
813 try: |
816 try: |
814 pf = open(outFile, "w", encoding="utf-8") |
817 pf = open(outFile, "w", encoding="utf-8") |
815 for key, list in sections: |
818 for key, list in sections: |
816 if len(list) > 0: |
819 if len(list) > 0: |
817 pf.write('{0} = '.format(key)) |
820 pf.write('{0} = '.format(key)) |