Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locale.SPANISH where is it?

Tags:

I try to change the language of my application to Spanish, but I cannot find it.

Configuration c = new Configuration(getResources().getConfiguration()); c.locale = Locale.SPANISH; // does not exists 

But this works:

c.locale = Locale.ENGLISH; 

Could somebody help me?

Thanks!

like image 568
R3tikus Avatar asked Jan 24 '13 21:01

R3tikus


People also ask

What is country locale?

A locale can be composed of both a base language, the country (territory) of use, and possibly codeset (which is usually assumed). For example, German is de, an abbreviation for Deutsch, while Swiss German is de_CH, CH being an abbreviation for Confederation Helvetica.

How do I find device locale?

Using an Application (don't forget to define it in your manifest) we get the default locale when the app starts (onCreate()) and we update it when the user changes the language in the Android settings (onConfigurationChanged(Configuration)). That's all there is.

What does locale en us mean?

The construct Locale.US is equivalent to: new Locale("en", "US"); This particular Locale constructor requires two arguments: The language code and the country code for the Locale that you want to create.

What is a locale code?

Locale codes are derived from a classification system originally developed by NCES in the 1980s to describe a school's location ranging from “large city” to “rural.” The codes are based on the physical location represented by an address that is matched against a geographic database maintained by the Census Bureau.


1 Answers

Did you try Locale spanish = new Locale("es", "ES");

(see Localization Android)

like image 156
Brett Avatar answered Sep 21 '22 06:09

Brett