Do not translate characters in translation files
This commit is contained in:
committed by
Raphael Coeffic
parent
30e3ac3399
commit
f7e2180b56
+20
-20
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
@@ -35,26 +35,26 @@ def main():
|
|||||||
out_file = codecs.open(args.output, 'w', 'utf-8')
|
out_file = codecs.open(args.output, 'w', 'utf-8')
|
||||||
|
|
||||||
for line in in_file.readlines():
|
for line in in_file.readlines():
|
||||||
# Do the special chars replacements
|
# # Do the special chars replacements
|
||||||
if args.bwlcd == "F":
|
# if args.bwlcd == "F":
|
||||||
for before, after in get_chars_encoding(args.language).items():
|
# for before, after in get_chars_encoding(args.language).items():
|
||||||
line = line.replace(before, after)
|
# line = line.replace(before, after)
|
||||||
else:
|
# else:
|
||||||
for before, after in get_chars_encoding_BW(args.language).items():
|
# for before, after in get_chars_encoding_BW(args.language).items():
|
||||||
line = line.replace(before, after)
|
# line = line.replace(before, after)
|
||||||
|
|
||||||
if line.startswith("#define ZSTR_"):
|
# if line.startswith("#define ZSTR_"):
|
||||||
before = line[32:-2]
|
# before = line[32:-2]
|
||||||
after = ""
|
# after = ""
|
||||||
for c in before:
|
# for c in before:
|
||||||
if ord('A') <= ord(c) <= ord('Z'):
|
# if ord('A') <= ord(c) <= ord('Z'):
|
||||||
c = "\\%03o" % (ord(c) - ord('A') + 1)
|
# c = "\\%03o" % (ord(c) - ord('A') + 1)
|
||||||
elif ord('a') <= ord(c) <= ord('z'):
|
# elif ord('a') <= ord(c) <= ord('z'):
|
||||||
c = "\\%03o" % (-ord(c) + ord('a') + 255)
|
# c = "\\%03o" % (-ord(c) + ord('a') + 255)
|
||||||
elif ord('0') <= ord(c) <= ord('9'):
|
# elif ord('0') <= ord(c) <= ord('9'):
|
||||||
c = "\\%03o" % (ord(c) - ord('0') + 27)
|
# c = "\\%03o" % (ord(c) - ord('0') + 27)
|
||||||
after = after + c
|
# after = after + c
|
||||||
line = line[:32] + after + line[-2:]
|
# line = line[:32] + after + line[-2:]
|
||||||
out_file.write(line)
|
out_file.write(line)
|
||||||
|
|
||||||
out_file.close()
|
out_file.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user