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

Setting locale on page load in React-Admin v3

I've been using React-Admin v2 and now is time to upgrade to the next major version. My app has a functionality to change the language of the login page on page load, for example depending on the url params. If there isn't any param set, the…
spexi
  • 59
  • 6
3
votes
1 answer

How to limit access to pages with some conditions?

I have two languages available on my website (English / Korean) using locale. But, some of the pages are not available Korean language so I want to temporarily hide the pages ( Blog, Podcast, FAQ). In index.html, I put a condition -if I18n.locale ==…
carrey
  • 109
  • 1
  • 8
3
votes
1 answer

Convert language code three characters (ISO 639-2) to two-character code (ISO 639-1)

I'm developing an android app using Text-to-Speech (TTS) engine. TTS component return the list of available languages as list of Locale objects. But both methods Locale::getLanguage and Locale::getISO3Language of each Locale object return the same…
Suppaman
  • 151
  • 1
  • 12
3
votes
0 answers

Preview different Locales of UIView wrapped to SwiftUI

I started trying out SwiftUI preview for UIKit views, (by using UIViewRepresentable) and encountered a tricky issue with this setup. I tried to preview the wrapped view in a different Locale using the environment modifier but it just doesn’t…
3
votes
3 answers

How to get 12 hour format time string when system is set to use 24 hour format

I want to get a time string like "10:00 PM", and I use the NSDateFormatterShortStyle to achieve this. However when the system is set to use 24-hour format, what I got is "22:00". Besides, I want to get a localized time string. For example, in…
Swordsfrog
  • 119
  • 2
  • 3
  • 8
3
votes
4 answers

Does Angular number pipe translate numbers to Arabic?

I am building an Angular v9 app that requires translating into a few different languages including Arabic. I believe the project is set up correctly using ar-SA as one of the locale ID's, however even though I am using the number pipe across the app…
ifancyabroad
  • 43
  • 1
  • 5
3
votes
1 answer

Bash / Date / French local env

I need to retrieve the month of a date (dd.month.year) and transform it into the digit YYYY-MM the source month is in french, so i try : # date --date="$(printf "01 %s" "January 2020")" +"%Y-%m" 2020-01 # LC_TIME=fr_FR date --date="$(printf "01…
zignet
  • 31
  • 3
3
votes
1 answer

Can I use a different number format across my app without changing the whole Locale?

I would like to keep the user’s language setting but force english style number formatting. So, say the user has their iPad set up in Hungarian. All the words should get drawn from the Hungarian Localizable.strings file. BUT! I want to show all…
Musection
  • 135
  • 6
3
votes
2 answers

Swift 5 with SwiftUI: How to change the environment locale on the fly

I have to let the user to choose the language of the app from a list. Putting the next line in the SceneDelegate works fine because it loads the specified language at the beginning: window.rootViewController = UIHostingController(rootView:…
BartBart
  • 31
  • 1
  • 2
3
votes
1 answer

How do I get the formula separator in a script?

I have a basic Google Sheets script and as part of the HTML sidebar I show the user the formula to type in; e.g. =myformula("bob", "ross"). This works for people in the U.S. and a lot of other countries but there are quite a few countries that use ;…
3
votes
3 answers

Perl + Curses: Expecting a UTF-8 encoded multibyte character from getchar(), but not getting any

I am trying out Bryan Henderson's Perl interface to the ncurses library: Curses For a simple exercise, I try to obtain single characters typed on-screen. This is directly based off the NCURSES Programming HOWTO, with adaptations. When I call the…
David Tonhofer
  • 14,559
  • 5
  • 55
  • 51
3
votes
1 answer

Integer presentation type in f-strings does not return expected format

I'm using python 3.8 in a Docker container. This is my docker file. # Python image FROM python:3.8.2-buster # Install locales RUN apt-get update RUN apt-get install -y locales RUN sed -i -e 's/# it_IT.UTF-8 UTF-8/it_IT.UTF-8 UTF-8/' /etc/locale.gen…
floatingpurr
  • 7,749
  • 9
  • 46
  • 106
3
votes
2 answers

having trouble with Cyrillic characters

I'm trying to use the standard library to match some Cyrillic words: // This is a UTF-8 file. std::locale::global(std::locale("en_US.UTF-8")); string s {"Каждый охотник желает знать где сидит фазан."}; regex re {"[А-Яа-яЁё]+"}; …
undercat
  • 529
  • 5
  • 17
3
votes
1 answer

Scala vs Java toUpperCase/toLowerCase

Scala borrows Java String methods like toUpperCase/toLowerCase. However, the way it does so is not very consistent: Scala on JVM stick close to Java semantics, thus: toUpperCase() is locale-sensitive and sticks to default locale (giving you…
GreyCat
  • 16,622
  • 18
  • 74
  • 112
3
votes
1 answer

Carbon locale not respected?

In my Laravel 6 app, I have Carbon::now()->locale() returning it as it should be. As confirmation that the locale is loaded, Carbon::now()->monthName correctly outputs febbraio. BUT Carbon::now()->format('F') and Carbon::now()->formatLocalized('%B')…
NevNein
  • 487
  • 4
  • 14