yodalee / PyLinguist

Qt translation file translator using python with Goslate
1 stars 2 forks source link

Generates something like kyrilian #2

Closed ghost closed 9 years ago

ghost commented 9 years ago

If I run $ python PyLinguist.py -i qucs_uk.ts -o qucs_de.ts -t de sucseccfully (see issue #1), I get kyrillic translations on my german .ts file!

PS Great idea to automatic translate via Google. :+1:

ghost commented 9 years ago

It's ukrainic! For "error" I get "Помилка"...

yodalee commented 9 years ago

why would you use qucs_uk as the input file? the qucs_uk is ukrainic I think? This translator only translate those "unfinished" translation. Maybe change to translate all.

ghost commented 9 years ago

Lol yes I see it! I thought "U"nited "K"ingdom = English.

yodalee commented 9 years ago

Fixed, now the script translate all entries, not just those "unfinished" You can try the newest version.

ghost commented 9 years ago

No, only the unfinished! Translations by hand have more quality, and should untouched.

yodalee commented 9 years ago

I see XD, allow me reset XD

yodalee commented 9 years ago

Reset Done.

ghost commented 9 years ago

Ehm...which ts file I should use as input? There is no english on...?

yodalee commented 9 years ago

Yeah, I'm wondering that too.... Actually you can use german translation as input, since this script only translate those untranslated entries. Also, if some common entries like "yes" is translated, the script will use the translation again, saving the time waiting response from google.

ghost commented 9 years ago

I think its (see the readme in the same folder) the qtgeneric_untransleted.ts.

yodalee commented 9 years ago

I doubt that, the number of entries are totally different, one got only 800 lines, the other is 20 thousand lines.

ghost commented 9 years ago

The english text is set natively in the source files with tr(""). So there is no need to have an own ts file for english. I am right?

ghost commented 9 years ago

Why you have a input file? The english text is always in the ts files! Just read the english text from the translation file directly.

yodalee commented 9 years ago

The translate progress is here:

  1. get the source text, like "line width"
  2. check translation record, see if "line width" is translated before" 3-1. if yes, use the previous translated version 3-2. if no, post to google translate.
  3. record this translation into record.

During read ts file in, it will save those entries without "unfinished" tag into record.

yodalee commented 9 years ago

Maybe we can generate a untranslated version of qucs_*.ts.

ghost commented 9 years ago

python PyLinguist.py -i qucs_de_same.ts -o qucs_de.ts -t de works. qucs_de_same.ts is just a dublicate of qucs_de.ts. THE ENGLISH WORDS ARE ALWAYS IN THE TRANLATION FILE! No need to set an input!!!!!

ghost commented 9 years ago

python PyLinguist.py -file qucs_de.ts -t de would do the job

yodalee commented 9 years ago

I wanna separate the input and output since I cannot guarantee the output of google translation is correct (actually goslate cannot translate "OK" with unknown reason)

ghost commented 9 years ago

Then call it backup file and run like python PyLinguist.py -file qucs_de.ts -backup qucs_de.backup.ts -t de

yodalee commented 9 years ago

Then there is not much difference =w= To be honest this is just a helping tool I think. It generates a translated version, the you can examine it, modifying something by hand. In the end, replace the origin version.

ghost commented 9 years ago

Yes but a clean syntax is elementary.

ghost commented 9 years ago

It should help, not confuse.

yodalee commented 9 years ago

How about that, use -file to specify the input file. It not update to this file, just output to something like ... maybe: qucs_de_examine_version.ts

ghost commented 9 years ago

What should this tool will do? It automatic translate TS files. This files have always a english part and a part to translate. Just keep it simple but clear: Two options, the filename and the language, if you want you can set a var for backuping. So I recommend: PyLinguist.py [-b] example: PyLinguist.py qucs_de.ts de -b will update the qucs_de.ts with the google translations with an backup file.

yodalee commented 9 years ago

I see, auto backup. I will modify this later. For now, dinner first XD

ghost commented 9 years ago

By the way, you can read the language directly from the ts file, I am right? If you will do so, the syntax could be PyLinguist.py [-b]

ghost commented 9 years ago

Ok cu :)

yodalee commented 9 years ago

Done, you can see the Readme. Backup is automatically on (I perfer this)