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
46
votes
5 answers

Couldn't translate Date to spanish with Locale("es_ES")

I'm trying to do a simple date format, it does work great, it's very easy, but the problem is the language. I used the locale "es_ES" to get "Miércoles" instead of "Wednesday" and sorts like that but i failed. Here's my code: SimpleDateFormat…
Ulises Layera
  • 874
  • 3
  • 9
  • 13
45
votes
2 answers

Letter "y" comes after "i" when sorting alphabetically

When using function sort(x), where x is a character, the letter "y" jumps into the middle, right after letter "i": > letters [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" [21] "u" "v" "w" "x" "y" "z" >…
zezere
  • 509
  • 4
  • 4
44
votes
11 answers

Design considerations for internationalization

I've read Joel's article on Unicode and I feel that I have at least a basic grasp of internationalization from a character set perspective. In addition to reading this question, I've also done some of my own research on internationalization in…
VirtuosiMedia
  • 52,016
  • 21
  • 93
  • 140
44
votes
3 answers

How do I strftime a date object in a different locale?

I have a date object in python and I need to generate a time stamp in the C locale for a legacy system, using the %a (weekday) and %b (month) codes. However I do not wish to change the application's locale, since other parts need to respect the…
MagerValp
  • 2,922
  • 1
  • 24
  • 27
44
votes
4 answers

IPython Notebook locale error

After installing the latest Mac OSX 64-bit Anaconda Python distribution, I keep getting a ValueError when trying to start the IPython Notebook. Starting ipython works fine: 3-millerc-~:ipython Python 2.7.3 |Anaconda 1.4.0 (x86_64)| (default, Feb 25…
Clayton
  • 1,525
  • 5
  • 19
  • 35
43
votes
2 answers

Time zone issue involving date fns format()

const dt = new Date('2017-12-12'); console.log(format(dt, 'YYYY-MM-DD')); The above code logs 2017-12-11 in the US, but 2017-12-12 in India. I followed this github thread here and tried out things but am not getting the desired results. My…
codeX
  • 4,842
  • 2
  • 31
  • 36
40
votes
2 answers

Get locale specific directory in My documents

I have my custom application that generates a directory in My documents path, after installation the application uses that directory, but i got an issue in Chinese windows OS, where my application folder name appears in Chinese, so is there any way…
Vaibhav
  • 411
  • 1
  • 5
  • 6
40
votes
10 answers

Setting java locale settings

When I use the default java locale on my linux machine it comes out with the US locale settings, where do I change this so that it comes out with the correct locale?
Simon Tucker
40
votes
3 answers

How do I change the locale that JasperReports uses?

The windows installed on my machine has the locale en_AU and that's what JasperReports uses. I already tried changing the locale of all users, including the Administrator but it still uses en_AU. How can I change that locale? Is it possible to…
Francisco Fiuza
  • 421
  • 1
  • 5
  • 4
39
votes
10 answers

Retrieve a list of countries from the android OS

I'm looking for a way to populate a spinner with a list of countries with their names. Can I retrieve it from the Android OS? Can someone please provide me an example?
user1187383
38
votes
5 answers

How can I list all available windows locales in python console?

On linux we can use locale -a to see the list of locales available. $ locale -a C C.UTF-8 en_US.utf8 POSIX Is it possible to do the same from python console on windows? This can be handy when you try to do locale.setlocale(locale.LC_ALL, '???')…
minerals
  • 6,090
  • 17
  • 62
  • 107
37
votes
8 answers

Convert accented characters to their plain ascii equivalents

I have to convert french characters into english on my php. I've used the following code: iconv("utf-8", "ascii//TRANSLIT", $string); But the result for ËËË was "E"E"E. I don't need that double quote and other extra characters - I want to show an…
ram
  • 593
  • 1
  • 8
  • 18
36
votes
2 answers

RESTful URL: where should I put locale? example.com/en/page vs example.com/page?locale=en

I'm deciding how to organize URL and put locale into it. I have two choices: example.com/en/page example.com/page?locale=en -- Google way en.example.com/page -- isn't good because I'm using subdomains From one side example.com/en/page looks better…
petRUShka
  • 9,812
  • 12
  • 61
  • 95
36
votes
8 answers

Convert decimal mark when reading numbers as input

I have a CSV file with data reading that I want to read into Python. I get lists that contain strings like "2,5". Now doing float("2,5") does not work, because it has the wrong decimal mark. How do I read this into Python as 2.5?
Till B
  • 1,248
  • 2
  • 15
  • 19
36
votes
4 answers

What is a good definition for language code and locale codes?

When to use en_GB and en-GB ? What is the difference ? Is there an ISO name for this ISO 639-1 (language) and ISO 3166 (country) combination ?
johnlemon
  • 20,761
  • 42
  • 119
  • 178