为Gujrati和印地文在Android的Languge支持 [英] Languge support for Gujrati and Hindi in android

查看:171
本文介绍了为Gujrati和印地文在Android的Languge支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 嗨任何机构知道我们如何支持印地文和Gujrati Languge支持机器人。
我用低于code,但它不支持,我只看到箱子。
我把RES /值喜/ string.xml文件夹字符串文件中,有用于印地文语言印地文language.it一些键值:
 

  

区域设置区域设置=新的语言环境(HI);           Locale.setDefault(区域);           配置配置=新配置();           config.locale =区域; getBaseContext().getResources().updateConfiguration(config,getBaseContext().getResources().getDisplayMetrics());

 哪位知道不是,请给我解决方案感谢名单。
 

解决方案

作为古吉拉特语和印地文语言不支持Android的,你仍然可以给支持你的应用程序。

有关古吉拉特复制 C:\ WINDOWS \ Fonts \中Shruti.TTF 文件到你的资源文件夹。 然后用下面的code。

  TextView的text_view =新的TextView(本);

字体的字体= Typeface.createFromAsset(getAssets(),Shruti.TTF);

text_view.setTypeface(字体);

text_view.setText(ગુજરાતી);
 

Shruti.TTF 文件是古吉拉特语字体。 同样,你可以添加对印地文文件的支持。

Hi any body know how we can support Hindi and Gujrati Languge support in android.
i used below code but it is not supported, i see only box.
i put string file in res/values-hi/string.xml folder there is some key value for Hindi language.it is used for Hindi Language:       

Locale locale = new Locale("hi"); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; getBaseContext().getResources().updateConfiguration(config,getBaseContext().getResources().getDisplayMetrics());

any know than please give me solution thanx.

解决方案

As gujarati and hindi languages are not supported by Android, you can still give that support to your Application.

For Gujarati copy the C:\WINDOWS\Fonts\Shruti.TTF file to your asset folder. then use the following code.

TextView text_view = new TextView(this);

Typeface font = Typeface.createFromAsset(getAssets(), "Shruti.TTF");

text_view.setTypeface(font);

text_view.setText("ગુજરાતી");

Shruti.TTF file is for Gujarati font. Similarly you can add support for hindi file.

这篇关于为Gujrati和印地文在Android的Languge支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆