primefaces / primefaces/primereact

Locale.js: PrimeReact object is deprecated but still used in Locale.js

Open
#5,819 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Discussion
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

PrimeReact object is deprecated, as PrimeReactContext should be used instead.
Nevertheless, in Locale.js script, this object is still used in other methods like "localeOptions".

This seems causing issues when these methods are used in component, i.e. Calendar component.
In my case, I am developing a web app using NextJs 13.5.6 + i18next and PrimeReact 10.3.3. When running the app in iPhone
browser (Safari or Chrome or Firefox have same behavior), the default locale remain set as 'en', despite
I have added other languages and changed the default locale using the locale() function.

Reproducer

Link to codesandbox - bug on mobile only, desktop is ok

PrimeReact version

10.3.3

React version

18.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

iOS 17.x (Tried with safari, chrome and Firefox)

Steps to reproduce the behavior

No response

Expected behavior

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Locale.js, especially localeOptions and the other methods that still use the deprecated PrimeReact object, and compare them with the PrimeReactContext approach described in the issue. Reproduce the linked CodeSandbox on iOS and verify that Calendar uses the selected locale instead of remaining on en.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, react, typescript
Domain
frontend, internationalization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.