为Gujrati和印地文在Android的Languge支持印地、Gujrati、Languge、Android

2023-09-05 01:35:29 作者:挽风

 嗨任何机构知道我们如何支持印地文和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.