Does anyone know a file translator run from a bat-file?
It can be a local translator program with its own dictionaries, it can be a program that accesses dictionaries on the Internet. and can be at all site. I know how to do it in Unix (Cygwin). And it is made in the system of Eidos. But Cygwin itself takes up a lot of space (about 300 MB) and Google translator stopped working
Translator launched from bat-file
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Translator launched from bat-file
Hi,
Google translator didn't stop, but is changed.
You can do it this way if you want. Don't use this too much or Google will block your IP.
sl=nl (Source Language)
tl=fr (To Language)
q=... text to translate
Google translator didn't stop, but is changed.
You can do it this way if you want. Don't use this too much or Google will block your IP.
Code: Select all
https://translate.googleapis.com/translate_a/single?client=gtx&sl=nl&tl=fr&dt=t&q=dit%20is%20een%20test
tl=fr (To Language)
q=... text to translate
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Translator launched from bat-file
Thank you, Chris! It's working!
For example:
Writes to the downloads folder file: а.txt this content:
[[["Hello World!","Привет, Мир!",null,null,1]],null,"ru"]
That's right.
With regard to limitations, it seems they are not very strong:
https://cloud.google.com/translate/pricing
https://cloud.google.com/translate/quotas
Chris! And how to set the file translation in this style?
Here found one more variant. Even easier to unpack the result:
As a result, the file is written to the download folder: f.txt with such content:
"{Hello World!}"
This raises two questions:
1. How to translate a file, not a string specified directly in the command in the address bar?
2. How to specify the path where to write the output file with the translation result?
And it may be possible to get the result of the translation immediately in the form of a variable value, as in C#:
https://studassistent.ru/charp/zapros-n ... oogle-ru-c
This would be much more convenient than taking the translation result from a file. And from the file, which generally speaking is unknown where
For example:
Code: Select all
https://translate.googleapis.com/translate_a/single?client=gtx&sl=ru&tl=en&dt=t&q=Привет, Мир!
[[["Hello World!","Привет, Мир!",null,null,1]],null,"ru"]
That's right.
With regard to limitations, it seems they are not very strong:
https://cloud.google.com/translate/pricing
https://cloud.google.com/translate/quotas
Chris! And how to set the file translation in this style?
Here found one more variant. Even easier to unpack the result:
Code: Select all
http://translate.google.ru/translate_a/t?client=x&text={Привет, Мир!}&hl=en&sl=ru&tl=en
"{Hello World!}"
This raises two questions:
1. How to translate a file, not a string specified directly in the command in the address bar?
2. How to specify the path where to write the output file with the translation result?
And it may be possible to get the result of the translation immediately in the form of a variable value, as in C#:
https://studassistent.ru/charp/zapros-n ... oogle-ru-c
This would be much more convenient than taking the translation result from a file. And from the file, which generally speaking is unknown where
Re: Translator launched from bat-file
Hi,
Use loadfromurl, then you get the result in a variable.
cResult := loadfromurl(...)
Use loadfromurl, then you get the result in a variable.
cResult := loadfromurl(...)
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Translator launched from bat-file
with this command does not work, because there are conflicts in ch-files, etc. And there is no option to appeal to the online translator with the translation of the file?
Re: Translator launched from bat-file
I'm using the loadfromurl() function of Phil Ide for years. It is working without any problem.
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Translator launched from bat-file
String:
works correctly from the address bar. But when you access it programmatically and write its output to a file, you get an incomprehensible encoding (Win 65001 (UTF-8) without ROM). This is when translated from Russian into English. Is there a parameter somewhere in this line that specifies the encoding of the input text? In principle, I Russian is not going to translate, so you can use it. Thank you!
Code: Select all
https://translate.googleapis.com/translate_a/single?client=gtx&sl=ru&tl=en&dt=t&q=Привет, Мир!