简体   繁体   中英

Can we Translate english into hindi?

I want to translate english to hindi but emualtor shows boxes ? help me...

final TextView textV = (TextView) findViewById(R.id.textView1);

    textV.setTypeface(Typeface.createFromAsset(getAssets(),"K010.ttf")); 
    try{
    Translate.setHttpReferrer("www.some.com");
    String str1=Translate.execute("love", Language.ENGLISH, Language.HINDI);
    textV.setText(str1);

still i am getting boxes.....help me

Emulator shows boxes...may mean that the required font support is not present on your machine...please check if the Hindi font has been installed... But I did not understand the need for you to use the webView.loadDataWithBaseURL()...this would not do the translation I think...This will just try to load the given data into the WebView...and may be as the Hindi font is not supported the boxes are being displayed...

Are you developing kind of translator application or web page? where you type English in one TextView and select the langauge to which it has to be translated and the press an buttons "Translate"...and the translated string will be displayed in other TextView...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM