Skip to content

[com.google.android.material.textfield.TextInputLayout] text language is not updated after locale update and activity recreate #2075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jannepanda opened this issue Feb 17, 2021 · 8 comments

Comments

@jannepanda
Copy link

Description:
The android:hint/app:helperText text language in TextInputLayout is not updated after activity is recreated with new locale.
This issue has been present since 1.3.0-alpha03. 1.3.0-alpha02 was the last release in which it worked to my knowledge.

Expected behavior:
Expected texts language to be updated with new set locale, like it does for other components, for example: MaterialButton.

Source code:
Please find a small sample project attached which shows the behavior
MaterialLocaleChangeTest.zip

. Switch between com.google.android.material:material 1.3.0 and 1.3.0-alpha02 to see the difference.

Android API version: Android API version here
API 23, API 29

Material Library version:
1.3.0

Device:
Tested on emulator and custom tablets

To help us triage faster, please check to make sure you are using the latest version of the library.

We also happily accept pull requests.

@jannepanda jannepanda added the bug label Feb 17, 2021
@matpag
Copy link
Contributor

matpag commented Feb 17, 2021

I got the same.
I suppose the problem is in this commit: 076ff69
The SavedState is saving the current text values, then when the device language is changed (and the app is in the recent list and re-opened or recreate() is called) those values are restored as they were before the configuration change

I can't confirm this is true because I did not tested it yet, I will as soon as I can.
If this is the case I can work on this

@hunterstich
Copy link
Contributor

Thanks for reporting @jannepanda. And thank you for attaching a sample.

I'll take a look.

@xxfast
Copy link
Contributor

xxfast commented Feb 26, 2021

Can confirm the issue can be replicated

@mohsenoid
Copy link

Any update regarding this issue??!!!

@TheKrushik
Copy link

I have this problem to

@matpag
Copy link
Contributor

matpag commented Aug 18, 2021

I added a temporary workaround here: https://stackoverflow.com/a/68529867/2910520

@wbervoets
Copy link

any update on this issue?

@mohsenoid
Copy link

Any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants