1

Closed

Getting error when trying to trranslate

description

Hi, I keep getting error when trying to translate files...
I am trying to translate XML files.

file attachments

Closed Jun 6, 2011 at 4:50 PM by Nedim
Google Translate will shut down on December 1, 2011.
New versions will remove support for it.

comments

Nedim wrote Feb 27, 2011 at 4:36 PM

According to http://code.google.com/apis/language/translate/terms.html
text is limited up to 5000 characters. Your request was larger than 5000 characters.

Nedim wrote Feb 27, 2011 at 4:47 PM

Checked source code and user can't make request larger than 5000 characters.
Can you attach your text you tried to translate?

megetron wrote Feb 27, 2011 at 6:13 PM

so there us a change request. :)
5000 is just few words.I have dosuments larger then 5000 words and I need to translate them all. can it split the calls and call google API few times for long text?
please notice the if you split XML then u wont splt in the midle of a tag.
eg
text 1 : "<hi>welcome</"
text 2: "hi>

in this case hi tag will be translated....
which is not good.

KevinFairchild wrote Feb 27, 2011 at 6:29 PM

Breaking it up into multiple requests is a possibility, but I'd like a little more information.

Translating "code" is a lot less trivial than normal written documents.

What is the goal of translating the XML files? Do these files have Document Type Definitions associated with them?

If translating HTML, you'd want to translate the text while leaving tags unchanged. I'd expect the XML files to be along the same lines -- with content getting translated, but what about elements, attributes, etc.? Seems like it depends on how you're looking to use it.

megetron wrote Feb 28, 2011 at 2:20 AM

You can create a default. elements, attributes, etc will not be translated.
Them, you can have a checkboxes "Translate Elements" "Translate attributes"
this way it will be much more flexible.

There are tons of standard documents neede to be translated different the simple documents.
:)

KevinFairchild wrote Feb 28, 2011 at 4:45 PM

@megetron, I totally agree that building in support for documents with greater than 5000 characters makes sense.

I don't know about supporting XML, HTML, etc., though....

While it's certainly a "would be cool if..." scenario, are there really that many people out there looking to do translations on the text within XML files?

If I wanted to do a Spanish port of a web app, for instance, I wouldn't run a translator on the code. The app would need to be written in such a way that what's displayed to the user is handled via tokens or whatever and then depending on the language chosen, the appropriate word, phrase, etc. is displayed in place of the token. This would also let the application address grammatical stuff. In English, we might display the message "Hello, Megetron". In another language, the correct translation might equate to something more along the lines of, "Megetron, hello."

Does that make sense?

I just think there are standard ways of addressing internationalization/localization of code without resorting to essentially substituting word 'x' in one language with word 'y' in another. And if we build special support for XML, we'd also need to build special code for identifying XML (verses HTML or any other tag-based language).

Nedim wrote Feb 28, 2011 at 5:04 PM

This is similar to bug in google API for NET.

This also will reproduce crash:

"Что касается require-mppe - эта опция необходима для подключения к
VPN-серверу используя 128-битное шифрование. Возможно у вас отсутвует
модуль ядра необходимый для её работы. Попробуйте /sbin/modprobe ppp_mppe
или заменить её на require-mppe-128 (в некоторых портах она так
называлась). Если не получится разобраться с шифрованием, замените адрес
vpn.qline.by на insec-vpn.qline.by (но в таком случаи, сохранность ваших
паролей и данных отправляемых внутири ppp-тоннеля не гарантируется)."

It works fine with bing.

It will take a lot of time to make custom API for google.

megetron wrote Mar 1, 2011 at 3:54 AM

Thanks Nedim.


KevinFairchild , all of the .resx files for ASP.NET are XML files that users are willing to translate.
I know lots of developers who were looking for such tools.
and finally, of course automatic translate is problematic. this is why ppl using it just for the first translation. after this, manually editing is requiered.
from my expirience automatic translation saves for abou 50% of your time translation.

megetron wrote Mar 5, 2011 at 9:47 PM

about the 5000 chatachters, I was trying to translate document with 1000 charachters but failed.
I think the limit is more like 500 and not 5000.
anyway, this limit should be removed:)

Nedim wrote Mar 27, 2011 at 8:11 PM

Here is script written in python which extracts text from xml.
In current directory it searches for xml files, extracts text and saves in file output.txt.

Nedim wrote Apr 1, 2011 at 8:39 PM

XML support is added in version 3.5.