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

When and why did the Swedish locale(s) change from formatting money sums between these formats?

I was one of the few people who bothered to learn how to format numbers and money sums. It used to be, and I thought it was still, like this: 123 456 789,00 123.456.789,00 The first one is a non-money-related number. The second is a money…
user12760574
3
votes
2 answers

How to detect locale?

I want to detect region and if it is not Spain I need to create check like this: if myRegion == Spain { //some code } else { //some code } I trying to do this like this but it is doesn't work: let myRegion = Locale.current if myRegion…
user
  • 41
  • 5
3
votes
1 answer

Android Kotlin get all system languages

On an android device I can load different languages. Example: English (Set as default language) French Italian How can I get this list programmatically? I know that I can get the language with this code: Locale.getDefault().getDisplayLanguage() Or…
Lingo
  • 580
  • 2
  • 7
  • 26
3
votes
1 answer

Using parseFloat() in different locales

I have an input field that is formatted using .toLocaleString(). Then I need to use parseFloat() on that value to convert it to a number. To do this with a US locale, I simply use value.replace(',','') to strip out the decimals before executing the…
Symphony0084
  • 1,257
  • 16
  • 33
3
votes
1 answer

Not able to change language locale in Kotlin

I have 2 string files "en" and "es". When ever I am changing the locale in locale manager class, it saves the new locale successfully but does not reflect changes on refreshing activity. MyApplication.kt open class MyApplication : Application()…
Kartika Vij
  • 493
  • 2
  • 4
  • 18
3
votes
2 answers

Currency.getSymbol() gives "US$" and "$" with different devices

While Initializing Currency, I set locale ad locale.US Currency.getInstance(Locale.US), but getSymbol() gives "US$" and "$ on different devices. getSymbol() gives "$" on samsung, but gives "US$" on moto. How to solve this.
Sandeep
  • 55
  • 9
3
votes
2 answers

Locale is returning empty string in Android

I am developing one android app and I need to do a certain change based on user's Locale country (region). I found an official link and I tried to get a Locale but it's returning me an empty string. Here is the code I tried but I am getting all the…
Harsh Shah
  • 2,162
  • 2
  • 19
  • 39
3
votes
1 answer

Spring i18n - Confusing default locales

Using a very simple Spring Rest HelloWorld example with intelliJ, I am trying to add internationalization (Locale.US as the default and just an alternative messages_es.properties to get the version in Spanish). This is my Java Config…
ElPiter
  • 4,046
  • 9
  • 51
  • 80
3
votes
2 answers

Is str(Bool) locale dependent

When in a python script I write >>> v = True >>> str(v).upper() 'TRUE' can I assume that 'TRUE' will always be the result, or can I have a translation of True in user terminal language (e.g 'WAHR' if user terminal is in German)?
user1531591
3
votes
3 answers

Sorting pandas dataframe with German Umlaute

I have a dataframe which I want to sort via sort_values on one column. Problem is there are German umlaute as first letter of the words. Like Österreich, Zürich. Which will sort to Zürich, Österreich. It should be sorting Österreich, Zürich. Ö…
joeagency
  • 33
  • 5
3
votes
2 answers

Platform browser dynamic providers not used

I'm trying to set my LOCALE_ID token before my angular app bootstraps by using the documentation method: import { LOCALE_ID } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from…
Alex
  • 1,090
  • 7
  • 21
3
votes
6 answers

display month name in french in php?

I am working on a php code as shown below: " data-timezone=""> ?> // Line A…
flash
  • 1,455
  • 11
  • 61
  • 132
3
votes
1 answer

Android locale file not loaded

The app supports os 8.0+ I have added the values-ar folder with support for strings.xml . If I change the language from phone settings to arabic, the app loads the correct resources. If I set the default locale at runtime in Application class, it…
ghita
  • 2,746
  • 7
  • 30
  • 54
3
votes
1 answer

JavaFX: How to Change the Locale in JFXDatePicker

I would like to change Locale of JFXDatePicker to my own custom Locale like into Cyrillic more precisely Uzbek Language. I searched google but there were no good tips about what to do. in this DatePicker, I would like to see my own custom string…
Jahongir Sabirov
  • 460
  • 1
  • 8
  • 24
3
votes
1 answer

Setting a locale of MeasurementFormatter instance voids any numberFormatter property options set on the instance

Solved Thanks to Martin R this has been solved by having to put the locale first. So: import Foundation let formatter = MeasurementFormatter() formatter.locale = Locale(identifier: "en_GB") // Set locale…