Tag Archives: locale
5,102 views
How to set different locales in android
– create new folder with values in resources folder in project with extension your language code For example: My language is Czech (cs) I have to create the folder values-cs in res folder // for locale English is default /MyProject/res/values … Continue reading
toLowerCase Locale toUperCase Locale Java Android
String s = "AbcČ"; String s2 = s.toLowerCase(new Locale("cs_CZ")); // Czech Republic String s3 = s.toLowerCase(new Locale("de_DE")); // Germany // en_US en_GB ar_EG be_BY bg_BG ca_ES cs_CZ da_DK de_DE
Locale location Java Android example
Locale lc = Locale.getDefault(); // default now locale on device String sCountry = lc.getCountry(); // CZ lc = new Locale("fr","FR"); //FRANCE .. Locale(language, country); String sCountry2 = lc.getDisplayCountry(); // Francie Locale locale = Locale.GERMAN; String sCountry3 = locale.getDisplayCountry(); … Continue reading
Formatting a Number to String NumberFormat DecimalFormat locale Java Android example code
NumberFormat, DecimalFormat, format(), locale format Java Androidexample source code NumberFormat numberFormat = new DecimalFormat("##"); String str = numberFormat.format(-01234.567); // -1235 System.out.print(str + "\n"); str = numberFormat.format(00); // 0 System.out.print(str + "\n"); numberFormat = new DecimalFormat("##00"); str = numberFormat.format(0); … Continue reading