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
31
votes
10 answers

How to validate a locale in java?

I read a file in an application that specifies a language code: public void setResources(String locale) { // validate locale // ULocale lo = new ULocale(locale); // System.out.println(lo.getDisplayCountry()); } that must be in the…
u123
  • 15,603
  • 58
  • 186
  • 303
31
votes
4 answers

Locale codes for iPhone lproj folders

Where would I find a list of locale name abbreviations for my project localization folders? (Such as en for English, fr for French). I am looking to do German, Spanish and others.
Moshe
  • 57,511
  • 78
  • 272
  • 425
31
votes
3 answers

python locale strange error. what's going on here exactly?

So today I upgraded to bazaar 2.0.2, and I started receiving this message (I'm on snow leopard, btw): bzr: warning: unknown locale: UTF-8 Could not determine what text encoding to use. This error usually means your Python interpreter doesn't…
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431
31
votes
7 answers

PHP intl country code 2 chars to country name

I'm trying to convert, using PHP, 2 characters country codes (ISO 3166-1) to country names, or intl country codes, so I can translate the country name. Using Locale::getDisplayRegion needs locale codes for languages (nl_NL) and all I have is the 2…
Surt
  • 581
  • 1
  • 5
  • 18
30
votes
2 answers

number_to_currency locale converting

Why does number_to_currency(33.50, :locale => :fr) displaying $33.50? It should display it in different currency based on the locale. I would expect a result of 33,50 €. Thanks a lot!
30
votes
3 answers

Why might Resources.getString() intermittently return strings from the wrong locale?

I have an Android application with English strings in values/strings.xml. For each string in that file, I have an entry in values-ja/strings.xml with the Japanese translation of that string. If I set the emulator, a Nexus One or Nexus S to Japanese,…
Bob Whiteman
  • 2,481
  • 2
  • 23
  • 27
30
votes
3 answers

Unable to locate package language-pack-en

On my NodeJS server (running as docker image)... Dockerfile FROM node:4.8-slim RUN apt-get update -y && \ apt-get install -yqq locales git ...there is no english locale installed: RUN locale -a gives me C C.UTF-8 POSIX In my dockerfile I try…
user3142695
  • 15,844
  • 47
  • 176
  • 332
30
votes
1 answer

Get language name in that language from language code

I have a list of language codes (as in "en", "es"...) I need to display in those language like this: English Español Français Deutsch 日本語 Is there any built-in API to get these in Android or should I map them myself?
Charlie-Blake
  • 10,832
  • 13
  • 55
  • 90
30
votes
4 answers

Various country's "currency decimal places width" in the iPhone-SDK

I read about NSLocaleCurrencySymbol, but where would I find the variable used to determine the "number of decimal places" used in a country's currency? I.E. In the USA, it's common to see dollar amounts written with 2 decimal places: $1.23 What…
Susanna
  • 771
  • 3
  • 10
  • 17
30
votes
3 answers

Set locale to system default UTF-8

When running R inside rApache, the locale is inherited from the Apache webserver, and therefore Sys.getlocale() is always equal to "C". I would like my web application to use UTF8, so I use: Sys.setlocale("LC_ALL", 'en_US.UTF-8') However this…
Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207
30
votes
3 answers

Who is responsible for deleting the facet?

I have a function that uses the Boost.DateTime library for generating the current GMT/UTC date and time string (live example). std::string get_curr_date() { auto date =…
Mark Garcia
  • 17,424
  • 4
  • 58
  • 94
30
votes
5 answers

is there a way to find list of valid locales in my linux using perl?

I need to find a list of locale installed/supported in my linux machine. is there a way to find a list of valid locales in my linux using perl ? thanks
user1318538
  • 321
  • 1
  • 5
  • 6
29
votes
7 answers

Dynamically change locale for DatePipe in Angular 2

I'm making an Angular project where the user has the ability to switch languages. Is it possible to make the locale dynamic? I have seen that you can add it in the NgModule, but I'm guessing it's not dynamic when I put it there? Or can I change it…
Martijn van den Bergh
  • 1,434
  • 1
  • 20
  • 40
28
votes
7 answers

Java 7 default locale

I have just installed jre7 and I'm surprised to see that my default locale is now en_US. With jre6 it was de_CH. What is different with jre7? Is the default locale no more the one of the Operating System? (btw, I'm using Windows7) Thx for your…
Neo
  • 1,337
  • 4
  • 21
  • 50
28
votes
7 answers

How to hack GHCi (or Hugs) so that it prints Unicode chars unescaped?

Look at the problem: Normally, in the interactive Haskell environment, non-Latin Unicode characters (that make a part of the results) are printed escaped, even if the locale allows such characters (as opposed to direct output through putStrLn,…
imz -- Ivan Zakharyaschev
  • 4,921
  • 6
  • 53
  • 104