material-components / material-components/material-components-android

[DatePicker] Calendar Date comes in Marathi Language when we change locale to Marathi

Open
#3,992 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Issue: Internationalization Widget: DatePicker
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** After setting locale 'mr' (Marathi language), the dates are showing in Marathi, this same issue happening in Bengali too for locale 'bn'.

**Expected behavior:** The dates should come in English only not in based on current locale.

**Source code:** Add below code in onCreate of MainActivity and Run the app
link: https://github.com/material-components/material-components-android/blob/master/catalog/java/io/material/catalog/main/MainActivity.java#L49

```
Locale myLocale = new Locale("mr"); // for bengali set 'bn'
Resources res = getResources();
DisplayMetrics dm = res.getDisplayMetrics();
Configuration conf = res.getConfiguration();
conf.locale = myLocale;
res.updateConfiguration(conf, dm);
onConfigurationChanged(conf);
```

**Android API version:** API 34

**Material Library version:** 1.9.0

**Device:** Emulator Pixel 2 API 33

Here is the proof of issue:

| Expected in Hindi Language | Unexpected in Marathi |
| ------------- | ------------- |
| ![Screenshot_20240115_121358](https://github.com/material-components/material-components-android/assets/13347416/f99eec96-5298-4d2d-a2b6-6b3c24973500) | ![Screenshot_20240115_121538](https://github.com/material-components/material-components-android/assets/13347416/65c81af0-e390-43f9-ba27-71dd0b51e0e8) |

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 with the MainActivity.java onCreate locale setup linked in the report and reproduce the DatePicker behavior using the Marathi (mr) and Bengali (bn) locales. Compare the displayed calendar dates with the expected English output. Done means DatePicker dates remain in English after either locale is applied.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.