Translate.py made less smart and broken up into translate.py and detranslate.py. This means that any source and target file names can be used.

Only translate.py is used by the Makefile
This commit is contained in:
kjell.kernen@gmail.com
2013-06-18 22:47:40 +00:00
parent bfe67b39f5
commit 76ee88eb4c
2 changed files with 110 additions and 5 deletions
+2 -5
View File
@@ -81,7 +81,7 @@ translations = {'cz': [('\\200', 'á'),
}
# Take care of command line options
parser = argparse.ArgumentParser(description='Decoder/Encoder for open9x translations')
parser = argparse.ArgumentParser(description='Encoder for open9x translations')
parser.add_argument('input', action="store")
parser.add_argument('output', action="store")
parser.add_argument('language', action="store")
@@ -98,10 +98,7 @@ in_file.close()
# Do the replacements
for before, after in translations[args.language]:
if args.input.endswith("." + args.language):
text = text.replace(after, before)
else:
text = text.replace(before, after)
text = text.replace(after, before)
# Write the result to a temporary file
out_file = open( args.output, 'w')