question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Locale not changing the language

See original GitHub issue

Describe the bug Hello, I’m using Luxon in React-Native project on IOS simulator. I’ve set Settings.defaultLocale = 'fr' to have my date to french translations. But seems to not working, I always got english translations. I’ve also tried to directly modify the local in the parameters, same result.

Capture d’écran 2021-06-11 à 12 54 08

To Reproduce

import { Settings, DateTime, Info } from "luxon";

Settings.defaultLocale = "fr";

console.log(
  "DateTime.now().locale =",
  DateTime.now().locale,
  "Info.months =",
  Info.months("long", { locale: "fr" })
);

Actual vs Expected behavior Have dates in french language

Desktop (please complete the following information):

  • OS: IOS 14.5
  • Browser [e.g. Chrome 84, safari 14.0]
  • Luxon version : 1.27.0

Thank’s for any help.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
icambroncommented, Jun 13, 2021

You’ll need to make sure that ICU is getting loaded into your environment, because Luxon uses internationalization capabilities built into the environment, using the Intl API. For example, they come built into the browser and newer versions of Node. I’m not sure how to do that in the iOS simulator, though.

0reactions
ArturoTorresMartinezcommented, Nov 1, 2022

I’ve the same issue when trying Info.months('long', {locale: "es-ES"}) or Info.months('long', {locale: "es"}) for Spanish

The array it returns is just 12 null values: [null, null, null, null, null, null, null, null, null, null, null, null]

Environment MacOS: 13.0 Simulator: iOS 16.0 React native version: 0.70.3 Luxon version : 3.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android app Locale language change not working for EN, but ...
I have managed to solve this issue by adding another locale for RO because Android Studio has en as default language.
Read more >
Visual Studio Code Display Language (Locale)
How to change the display language (locale) of Visual Studio Code. ... switch. If the matching Language Pack is not installed, VS Code...
Read more >
Language, Locale, and Currency Settings - Salesforce Help
The Salesforce settings for language, locale, time zone, and currency can affect how objects, such as Accounts, Leads, or Opportunities, are displayed.
Read more >
Language and locale resolution overview - Android Developers
Resource resolution without an exact locale match. ... resolution when the app only matches the user's second-preferred locale setting.
Read more >
How do I view and change the system locale settings to ... - Java
Click Start then Control Panel · Click Clock, Language and Region · Windows 10, Windows 8: Click Region · Click the Administrative tab...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found