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
2 answers

show time from milliseconds by using toLocaleTimeString()

I am attempting to show the time using milliseconds. I'm using the toLocaleTimeString since it supports the locale. var milliseconds = 10000; var date = new Date(milliseconds); console.log(date.toLocaleTimeString('en',milliseconds)); //…
Sachila Ranawaka
  • 39,756
  • 7
  • 56
  • 80
3
votes
1 answer

How do I make IntelliJ IDEA honor user.language and user.country from Gradle config?

I want to make sure my app always builds, runs tests, and runs using the correct locale, regardless of build & run platform. So I have a simple unit test that checks that new Locale("nb", "NO") == Locale.getDefault() Running the build with locale…
neu242
  • 15,796
  • 20
  • 79
  • 114
3
votes
1 answer

Using Joda DateTimeFormatter.withLocale() only affects the string value for am/pm, not the time format

Explicitly using withLocale to set the locale to German results in the am/pm string being localized in the time value, but does not convert to the 24 hour time format which is correct for that locale. When a new process is created, with the…
Bill B
  • 51
  • 2
3
votes
2 answers

Symfony2.8 get locale in form types

How can I get the locale in a typeform? This is in my controller: $form = $this->createForm(new ConfiguratorClientType(), $configuratorClient); I have this in my form builder: ->add('language', EntityType::class, array( 'class' =>…
Keutelvocht
  • 670
  • 2
  • 10
  • 28
3
votes
3 answers

toLocaleString price without decimal zeroes

I am wondering how to efficiently remove the decimal zeroes from a price while keeping the 2 decimals if there So if a price is 135.00 it should become 135. If a price is 135.30 however it should keep both decimals. If a price is 135.38 it can…
Stephan-v
  • 19,255
  • 31
  • 115
  • 201
3
votes
4 answers

In C#, how to get the "Country or region" selected under "Region & language" in Windows 10?

I am running Windows 10. When I open "Region & language settings" from the start menu, I can select a "Country or region". I am trying to get this value in a C# program. I am in Denmark. I have tried changing my country to Germany (see screenshot),…
Claus Appel
  • 379
  • 1
  • 4
  • 13
3
votes
0 answers

Laravel localization in 404 page using session

I set locale in middleware using session variable and it is working perfectly except 404 page. As I understood, neither session variables nor middleware works in exception handler. Here is my code: Route: Route::get('setlocale/{locale}',…
3
votes
1 answer

linux what locale to set for cp850

I want to set a locale in a script so that cp850 codepage is used for the string that is handled by the script which will be written in a json-file. I have found I can set LANG=de_DE.utf8 and I have found that some locales have a .cpXXX in the…
Stajl
  • 53
  • 4
3
votes
4 answers

Why String.endsWith and String.startWith are not consistent?

I have the below test case and only the first assertion passes. Why? @Test public void test() { String i1 = "i"; String i2 = "İ".toLowerCase(); System.out.println((int)i1.charAt(0)); // 105 System.out.println((int)i2.charAt(0)); //…
Mehmet Ataş
  • 11,081
  • 6
  • 51
  • 78
3
votes
0 answers

locale issue while upgrading data directory from PostgreSQL 8.4 to 9.5

I am upgrading PostgreSQL 8.4 to 9.5 on Windows. Following are the steps that are to be followed: Install PostgreSQL 9.5 (8.4 is already installed). Migrate data from 8.4's data dir to 9.5's data dir using pg_upgrade utility. After successful…
user
  • 383
  • 1
  • 5
  • 20
3
votes
1 answer

QTextToSpeech Set Default QLocale

In Qt 5.9.0, The QTextToSpeech class provides a convenient access to text-to-speech engines. There is a Qt example for QTextToSpeech here. How Can I change locale and write other language(non-english) ? I tried this code, not working: QLocale…
Farhad
  • 4,119
  • 8
  • 43
  • 66
3
votes
4 answers

Is it possible to support rtl text direction according to app's locale while phone is in English?

I managed to support rtl layouts when I have turned my phone's language in aramaic and have set my app's locale accordingly. What I haven't managed to do, and to be honest I wonder if it's possible, is to support rtl layouts when app's locale is set…
antonis_st
  • 468
  • 3
  • 16
3
votes
2 answers

Android RTL issue in API 24 and higher on locale change

I was trying to change locale of app at runtime. It is working fine in Andorid below API level 24. But in API level 24 or greater the layout direction is not changing according to locale. Below is the code to change the locale at runtime. I have…
3
votes
0 answers

Sonata Admin - disable translations

I would like to disable SonataAdminBundle translations and it to be only in english no matter what other locale is set. Is there a way to handle through config? Or should I force english locale on every Kernel Request? Maybe rewrite translation…
user3076049
3
votes
2 answers

What ISO is used to define the countryId in a Locale?

If i read the Javadocs for Locale, i see that exists a constant UK for United Kingdom (i think :P) But if i read the class documentation, it says: The country argument is a valid ISO Country Code. These codes are the upper-case, two-letter…
nacho
  • 31
  • 1