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:
+2
-5
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user