+ all_langs = []
+ all_sublangs = []
+
+ lngtable = ''
+ ifdefs = ''
+
+ for i in table:
+ ican = '"%s"' % i[1]
+ if ican == '"-"': ican = '""'
+ ilang = i[2]
+ if ilang == '-': ilang = '0'
+ isublang = i[3]
+ if isublang == '-': isublang = '0'
+ lngtable += ' LNG(%-38s %-7s, %-15s, %-34s, %s)\n' % \
+ ((i[0]+','), ican, ilang, isublang, i[4])
+ if ilang not in all_langs: all_langs.append(ilang)
+ if isublang not in all_sublangs: all_sublangs.append(isublang)
+
+ for s in all_langs:
+ if s != '0':
+ ifdefs += '#ifndef %s\n#define %s (0)\n#endif\n' % (s, s)
+ for s in all_sublangs:
+ if s != '0' and s != 'SUBLANG_DEFAULT':
+ ifdefs += '#ifndef %s\n#define %s SUBLANG_DEFAULT\n#endif\n' % (s, s)
+