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
1 answer

Using boost locale generator correctly

I want to store utf8 characters in my std::strings. For that I used boost::locale conversion routines. In my first test everything works as expected: #include std::string utf8_string = boost::locale::conv::to_utf("Grüssen",…
Reine Elemente
  • 131
  • 1
  • 11
3
votes
3 answers

Check if a grouping separator is a space

I am trying to check wether a grouping separator (char) is a space or not. It's the case for the french locale but my test always prints false. DecimalFormat formatter = (DecimalFormat) DecimalFormat.getInstance(Locale.forLanguageTag("fr")); char ch…
Charles Follet
  • 827
  • 1
  • 10
  • 28
3
votes
0 answers

Python (Jupyter): ValueError: unknown locale: UTF-8

I've read through a dozen google entries and other SO questions regarding the same issue but I can't fix it. The example error code is: import matplotlib as plt, but plenty of other things will trigger it. The whole output…
Neithan Max
  • 11,004
  • 5
  • 40
  • 58
3
votes
0 answers

Reload current fragment on locale changed

I have language changer which is in activity. In my current situation I use recreate(), but this way it redraw first fragment. Example: I had four pages which are fragments. When I am at let say fourth and I change language - it redraw the first…
IntoTheDeep
  • 4,027
  • 15
  • 39
  • 84
3
votes
3 answers

What is the best way to determine the correct Charset for a given LCID at runtime in VB6?

I am displaying Japanese characters in a VB6 application with the system locale set to Japan and the language for non Unicode programs as Japanese. A call to GetACP() correctly returns 932 for Japanese. When I insert the Japanese strings into my…
fran
  • 365
  • 1
  • 3
  • 19
3
votes
0 answers

How to set locale / localize currency symbols in django template

I'm trying to localize where I put my currency symbols in my django template (before vs after the number and spacing are both important). Example: {{ price }} {{ some_model.currency }} Where: some_model is an object, with property…
Escher
  • 5,418
  • 12
  • 54
  • 101
3
votes
1 answer

Reverse wstring in C++

I need to reverse wstring. I have such code: #include #include #include int main() { std::wstring s; std::getline(std::wcin, s); for (const auto &i : s) { std::wcout << (int) i << " "; } …
0x1337
  • 1,074
  • 1
  • 14
  • 33
3
votes
1 answer

Create "values-en" folder dynamically in android

First of all sorry for my weak english. I was searching for how to change language of my android application. I found in lots of link saying that creating values-fr (for french), values-en (for english) etc and copying strings.xml file into those…
Hilal
  • 902
  • 2
  • 22
  • 47
3
votes
1 answer

Broken encoding in npm test output triggered by Jenkins running in docker

I've been with a big headache for months. We're working with a continuous integration pipeline and one of the steps is an automated test triggered by npm test, which will take place inside a jenkin's slave running in a docker container, Jenkins…
Rogério Peixoto
  • 2,176
  • 2
  • 23
  • 31
3
votes
1 answer

"toLocaleString" giving different output on different browsers

var num = 1239128938213092131823; num.toLocaleString('en-IN', { maximumSignificantDigits: 3, style: 'currency', currency: 'INR'}); on chrome: on Firefox: The Comma pattern output is different in both browsers. Firefox output is what i want and i…
Vikramaditya
  • 5,444
  • 6
  • 34
  • 45
3
votes
2 answers

Spring mvc get default locale from request if locale is invalid

I've got i18n configured in my Spring MVC app (localeInterceptor etc). Two languages supported (en & pl). PL is default one. I18n works of course. My case is to get current locale and pass it to model. That's easy, but when I pass invalid locale…
Rotek
  • 65
  • 1
  • 10
3
votes
3 answers

date string is showing question marks

I am using Eclipse 4.5.1 Mars. I have a very simple program which just use Hindi as locale and print out the date in a format: But when run it, the console print out question marks. But if I remove the Hindi locale, it prints out correct date…
Leem.fin
  • 40,781
  • 83
  • 202
  • 354
3
votes
1 answer

Where is locale_gen localted on FreeBSD?

I have only two locales installed $ locale -a C POSIX I want to use utf-8 character encoding and hence want to install en_US.UTF-8 For ubuntu I found locale_gen which does the job. Is this utility, or any similar utility present for FreeBSD? If…
Apoorv
  • 2,525
  • 2
  • 14
  • 18
3
votes
3 answers

Consistent implementation of tr?

I have a ksh script that generates a long, random string using /dev/urandom and tr: STRING="$(cat /dev/urandom|tr -dc 'a-zA-Z0-9-_'|fold -w 64 |head -1)" On the Linux and AIX servers where I used this it resulted in 64 characters of upper and lower…
T.Rob
  • 31,522
  • 9
  • 59
  • 103
3
votes
1 answer

Change language programatically in Android with country code

I want to change my app locale to pt_BR. I have done the below things. The code to change locale: Locale locale; if (localeName.contains("_")) { String localNameArray[] = localeName.split("_"); locale = new…
Prithniraj Nicyone
  • 5,021
  • 13
  • 52
  • 78