Dynamic translation for chat
8 years 2 weeks ago #2187
by Smartin
Dynamic translation for chat was created 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
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.
8 years 2 weeks ago #2188
by Frank
Are you
Give I2L
5 stars!
Are you
Please lets us know how to improve it!
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:
Hope that helps,
Frank
string text = I2.Loc.GoogleTranslation.ForceTranslate("Hello World", "auto", "es");
//or
GoogleTranslation.Translate("Hello World", "auto", "es", OnTranslationReady);
Hope that helps,
Frank
Are you

Are you

To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
8 years 2 weeks ago - 8 years 2 weeks ago #2189
by Smartin
Replied by Smartin on topic Dynamic translation for chat
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!
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 weeks ago by Smartin.
Please Log in or Create an account to join the conversation.
Time to create page: 0.153 seconds