Write translation for different language by default.
--- a/py/gadict_c5.py Mon Mar 28 00:59:48 2016 +0300
+++ b/py/gadict_c5.py Mon Mar 28 01:00:32 2016 +0300
@@ -13,6 +13,9 @@
FINAME = sys.argv[1]
if len(sys.argv) >= 3:
FONAME = sys.argv[2]
+LANGS = None
+if len(sys.argv) >= 4:
+ LANGS = set(sys.argv[3].split(","))
FIN = io.open(FINAME, mode='r', buffering=1, encoding="utf-8")
@@ -89,8 +92,18 @@
FOUT.write("⟨")
FOUT.write(pos)
FOUT.write("⟩ ")
+ FOUT.write("\n")
for (lang, tr) in trs:
- if lang == "ru":
+ FOUT.write(" ")
+ if LANGS is None:
+ FOUT.write(lang)
+ FOUT.write("→ ")
FOUT.write(tr)
- break
- FOUT.write("\n")
+ elif lang in LANGS:
+ if len(LANGS) == 1:
+ FOUT.write(tr)
+ else:
+ FOUT.write(lang)
+ FOUT.write("→ ")
+ FOUT.write(tr)
+ FOUT.write("\n")