Dynamic translation for chat

More
8 years 2 months ago #2187 by Smartin
Hi,

In the example for dynamic translation you hardcode which language is being translated to what.

For chat, it obviously would have to be dynamic as I don't know what each users selected language is ahead of time. How would you suggest I detect what language the original message is in, in order to translate to the users selected language?

Thanks,
Steve

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

More
8 years 2 months ago #2188 by Frank
Replied by Frank on topic Dynamic translation for chat
Use "auto" as the original language. That will make google to detect the language from the text:
string text = I2.Loc.GoogleTranslation.ForceTranslate("Hello World", "auto", "es");
//or
GoogleTranslation.Translate("Hello World", "auto", "es", OnTranslationReady);

Hope that helps,
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
8 years 2 months ago - 8 years 2 months ago #2189 by Smartin
That's awesome, thanks!

Can I also use "auto" to translate to whatever the user currently has set as their default language?

Edit: I figured it out. Thanks for the help!
Last edit: 8 years 2 months ago by Smartin.

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

Time to create page: 0.159 seconds
Template by JoomlaShine