Dynamic translation problem

More
7 years 3 months ago #2446 by Smartin
Hi,

I'm trying to use GoogleTranslation.Translate on some text that's dynamic. No errors are returned but the following is the translation:

<!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Error</title><style type="text/css">body {background-color: #fff; margin: 0; padding: 0;}.errorMessage {font-family: Arial,sans-serif; font-size: 12pt; font-weight: bold; line-height: 150%; padding-top: 25px;}</style></head><body style="margin:20px"><div><img alt="Google Apps Script" src="//ssl.gstatic.com/docs/script/images/logo.png"></div><div style="text-align:center;font-family:monospace;margin:50px auto 0;max-width:600px">Invalid argument: target (line 33, file &quot;Translate&quot;, project &quot;Copy of I2GoogleWebServiceV4&quot;)</div></body></html>
UnityEngine.Debug:LogError(Object)

Is there something I didn't setup correctly? Thanks so much!


-Steve

Please Log in or Create an account to join the conversation.

More
7 years 3 months ago #2447 by Frank
Replied by Frank on topic Dynamic translation problem
Hi,
The problem seems to be that google is not recognizing the language into which you are trying to translate.

If you are translating a term in a LanguageSource, double check that all of the languages have the correct language code (e.g. "en" or "en-US")
If you are using the runtime translation, then you need to specify a correct language code or set "auto" for the original language.

Also, could I ask you into which languages you are localizing. (and what variants if any (e.g. en-CA, es-MX), etc) If its a non common language, I could try it on my side and spot any error.

Thanks,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
7 years 3 months ago #2448 by Smartin
Replied by Smartin on topic Dynamic translation problem
Oh, I see... that helps! Was able to find the problem.

I was using:

I2.Loc.GoogleTranslation.Translate(name, "auto",I2.Loc.LocalizationManager.CurrentLanguage, QuestNameTranslation);


When I should've been using...

I2.Loc.GoogleTranslation.Translate(name, "auto",I2.Loc.LocalizationManager.CurrentLanguageCode, QuestNameTranslation);


Thanks!

Please Log in or Create an account to join the conversation.

Time to create page: 0.133 seconds
Template by JoomlaShine