在 Android 中将英文文本翻译为印地语
我想将英语文本转换为印地语并将其显示在 TextView 中。我遵循以下 URL http://android-er.blogspot.com/2009/10/androidtranslate-using-google-translate.html 但它似乎不起作用。 还有其他方法吗?请帮帮我。
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.read_view);
mTts = new TextToSpeech(this,this);
try {
setTranslate();
} catch (Exception e) {
e.printStackTrace();
}
}
private void setTranslate() throws Exception {
String OutputString = Translate.execute("hello",
Language.ENGLISH, Language.HINDI);
TextView tv = (TextView) findViewById(R.id.translate);
tv.setText(OutputString);
}
在这里,我尝试在 TextView id“translate”中显示印地文文本
I want to convert a text in English to Hindi and display it in the TextView.I followed the following URL http://android-er.blogspot.com/2009/10/androidtranslate-using-google-translate.html but it dosen't seems to work.
Is there any other method to do it?Help me out.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.read_view);
mTts = new TextToSpeech(this,this);
try {
setTranslate();
} catch (Exception e) {
e.printStackTrace();
}
}
private void setTranslate() throws Exception {
String OutputString = Translate.execute("hello",
Language.ENGLISH, Language.HINDI);
TextView tv = (TextView) findViewById(R.id.translate);
tv.setText(OutputString);
}
Here I am trying to display hindi text in the TextView id "translate"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Microsoft Bing Translator 提供了此英语-印地语的翻译器,并且对于有限的搜索完全免费。
http://www.microsoft.com/web/post /使用-free-bing-translation-api。
Microsoft Bing Translator offers a translator for this english-hindi and its completely free for a limited searches.
http://www.microsoft.com/web/post/using-the-free-bing-translation-apis.
确保您的应用程序具有互联网权限
添加谷歌翻译API jar即 google.api.translate-java-0.90.jar
另请检查此 客户端 api< /a> 它来了当您想要轻松处理某些事件和请求时,有时很有用
make sure your application does have internet permission
add google translate api jar i.e google.api.translate-java-0.90.jar
Also check this client api it comes useful some times when u want to handle certain events and requests with ease