Support for multiple languages ​​in different languages ​​without localization

Hi, I am working on an Android project.

I want to provide multi-language support for an application. I researched about this, but I found almost everything with localization.

Is there any way to do this without using localization?

My preference is to use language support for localization or supported versions.

I mean, the user can switch languages ​​in the application.

Can I do this with multiple value files?

+3
source share
3 answers

Use this to change the language by code -

Locale locale = new Locale("en_US"); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; context.getApplicationContext().getResources().updateConfiguration(config, null); 

Enter the country code instead of "en_US" in any language you want ... for example, for japanese - "ja_JP" For Arabic - "ar" or check this link for the country code -

http://code.google.com/apis/igoogle/docs/i18n.html

And create a folder in res / values-ja for japanese or res / values-ar for arabic.

And create a string.xml file. Put the languages ​​on your layout. It will select the default language from the values ​​folder, otherwise you want it manually, then it will extract the external folder-ar from your values, etc., How ...

His res / values-ar example for Arabic is

 <?xml version="1.0" encoding="UTF-8"?> <resources> <string name="spinner_label">تصفية حسب</string> <string name="app_name">2011 فرق</string> <string name="search">بحث :</string> </resource> 

Hope this helps you.

+4
source

You can use the default language files from Android and set the language that should be used before calling setContentView (). Here is a short article about it: http://adrianvintu.com/blogengine/post/Force-Locale-on-Android.aspx

0
source

yes, you fill out your request using

 Locale locale = new Locale("en_US"); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; context.getApplicationContext().getResources().updateConfiguration(config, null); 

and after that follow this link to change app lang

0
source

All Articles