Questions tagged [locale]

In computing, locale is a set of parameters that defines the user's language, country and any special variant preferences that the user wants to see in their user interface. Usually a locale identifier consists of at least a language identifier and a region identifier.

Examples of variable output controlled by a locale is whether a date is displayed as 25/12/2012 or 12/25/2012 or some other format, and whether a decimal number is displayed as 123,456.78 or 123.456,78

5203 questions
3
votes
4 answers

Java DateFormat/SimpleDateFormat with Locale (show just day in month and month)

I have a multicultural application, the project uses Java 7. I need to show the date, but the day in month and month only. So for example in Locale.UK today's date looks like: 24/01, but in Locale.US like: 1/24. How to achieve this in Java 7? I…
bladekp
  • 1,529
  • 22
  • 29
3
votes
1 answer

How to disable character codes 178 (0xB2) (²) , 179 (0xB3) (³), and 185 (0xB9) (¹) as digits?

With SWI-Prolog when generating digits using code_type(X,digit). the result is the expected ASCII character codes and 178 (0xB2) ² 179 (0xB3) ³ 185 (0xB9) ¹ e.g. code_type(X,digit). X = 48 ; X = 49 ; X = 50 ; X = 51 ; X = 52 ; X = 53 ; X = 54…
Guy Coder
  • 24,501
  • 8
  • 71
  • 136
3
votes
2 answers

Android: How to set Locale to zh_HK android

I am facing issue with setting in app locale to zh_HK. The code Locale locale=new Locale("zh_HK") also not working and upon printing locales.getAvailable locales list, I am getting zh_HK_#Hans,zh_HK_#Hant. Further more setting Locale locale=new…
mradss
  • 31
  • 3
3
votes
1 answer

How to overload comparator to sort with UTF-8 and different locales

I have a collection of data: ["Alphabet","Zend","Ćwiczenia"] as result collection.sort I get: ["Alphabet","Zend","Ćwiczenia"]. How to overload comparator to sort with UTF-8 and different locales?
Przemek eS
  • 1,224
  • 1
  • 8
  • 21
3
votes
2 answers

NumberFormatException for input string: "15,7"

I am getting a NumberFormatException when trying to parse a number such as "15,7". This would be "15.7" in US or UK format. I've attempted to retrieve the locale from the PC and parse based on that, as follows: if (strCountry.equals("IT")) { …
petehallw
  • 1,014
  • 6
  • 21
  • 49
3
votes
0 answers

Web Crawler problems in Python

I've been working on creating a single-threaded Web Crawler in Python that will group the assets of each page and output a JSON array of the form: [ { url: 'http://url.com/', assets: [ 'http://url.com/imgs/img1.jpg', …
Connor Cartwright
  • 385
  • 2
  • 3
  • 14
3
votes
0 answers

Laravel 5.3 multilanguage locale doesn't work

I need to add another language to a laravel project, I did all the translation files and changed all the text to {{trans()}}. I just can't change the URIs to seLocale so I wrote this route Route::get('/changelanguage', function(){ …
Beshoy Tamry
  • 75
  • 1
  • 11
3
votes
2 answers

Java Days of week in 2 letters for each locale

Is there any way I can get days of week as 2 letter? Ex: Su, Mo, Tu, We .... I tried Java DateFormatSymbols and it gives 3 letter short names for days. DateFormatSymbols symbols = new DateFormatSymbols(this.locale); …
JagKum
  • 183
  • 2
  • 18
3
votes
1 answer

django-oscar categories and products translations

I want to use django-oscar for building an web shop and this shop will provide two main languages. Oscar's translations do very well with regular fields like View chart or Add to chart, but does not support custom elements e.g. Categories or…
3
votes
1 answer

How to print/see predefined patterns [:alnum:], [:punct:], [:digit:], [:blank:] etc. in R Regular Expressions

Where I can see codes for the predefined patterns for Regular Expression in R? The documentation says it is related to locales/POSIX locale. > [[:alpha:]] > [:alpha:] Does not print anything. How to look for predefined patterns and the…
Sowmya S. Manian
  • 3,723
  • 3
  • 18
  • 30
3
votes
2 answers

How to convert unicode characters to uppercase in C++

I'm learning about unicode in C++ and I have a hard time getting it to work properly. I try to treat the individual characters as uint64_t. It works if all I need it for is to print out the characters, but the problem is that I need to convert them…
Linus
  • 1,516
  • 17
  • 35
3
votes
2 answers

How can I change language back and forth with a button?

I am trying to change the Language by pressing a button in the menubar, but i want it to switch between Norwegian and English Language. So if the the locale.toString() is "no" i'll switch to "en" and vise versa. My problem is that i only get it to…
Kim Vu
  • 584
  • 9
  • 25
3
votes
1 answer

Is Android device's locale based solely on Language setting?

If the device chooses French as the language, will the locale automatically set to French as well? Or does it depend on user's current location? For iOS, language and region are separate settings while in Android, seems like we only get to choose…
Bruce
  • 2,357
  • 5
  • 29
  • 50
3
votes
2 answers

Numeric keyboard. Dot instead of comma

In layman terms my goal is to change how the "dot" button on numeric keyboard behave. Now once tapped it produces a "comma". I need it to produce a "dot". After research I started toting with locale. Apparently my locale is set to en_US: [xxx@xxx…
3
votes
3 answers

Date conversion to a different locale

I am working on an Android project in which I'm implementing localization. I'll be getting the locale and the time zone. Using this information, I have written the below code: String []locale= User.getInstance().getLanguage().split("-");//Assume,…
Zax
  • 2,870
  • 7
  • 52
  • 76