-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
#5341 When the app language sets to French and OS language sets to Chinese,… #5364
base: main
Are you sure you want to change the base?
Conversation
… the depiction and license both use French language.
Would you mind rebasing (or pulling) from the main branch? Thanks! :-) |
Yes, finish pulling from main branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, it works great!
There seems to be many unrelated changes, please undo them.
Please remove the logging lines that are not really necessary.
I asked for a few other things, please mark each as resolved when each is done.
Then please refresh this page to review your pull request's code.
Thanks a lot!
data-client/src/main/java/org/wikipedia/language/AcceptLanguageUtil.java
Show resolved
Hide resolved
data-client/src/main/java/org/wikipedia/language/AcceptLanguageUtil.java
Outdated
Show resolved
Hide resolved
app/src/main/java/fr/free/nrw/commons/upload/structure/depictions/DepictModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/fr/free/nrw/commons/upload/structure/depictions/DepictModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/fr/free/nrw/commons/upload/structure/depictions/DepictModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/fr/free/nrw/commons/explore/depictions/DepictsClient.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/fr/free/nrw/commons/explore/depictions/DepictsClient.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/fr/free/nrw/commons/di/CommonsApplicationModule.java
Outdated
Show resolved
Hide resolved
I just updated all changes requested now. Ready to review :) |
app/src/main/java/fr/free/nrw/commons/di/CommonsApplicationModule.java
Outdated
Show resolved
Hide resolved
What is the status of this PR? What changes are required now? |
I am so sorry for the delay! @u7452206 I know this is my fault, but would you mind fixing the conflicts? Thanks for your understanding :-) |
Description (required)
When the app language sets to French and OS language sets to Chinese,the depiction and license both use app language now. Fixes #5341
What changes did you make and why?
In order to fix License language
In the CommonsApplicationModule.java class and in provideLicenses function,
the purpose of this code to change the application's language settings based on the user's language preference saved in SharedPreferences.
In order to fix depiction language
In the DepictsClient class and byLanguageOrFirstOrEmpty function, beside adding a getSavedLanguage function
The primary use-case for this function is when the application needs to display a label for a specific item. It first tries to display the label in the user's preferred language. If that isn't available, it displays any available label. If none are available, it displays nothing (returns an empty string). The origin code takes the context language from Locale of the phone but not the one from the app ui language.
Above three photos magnifications all presents taking app setting language out.
Tests performed (required)
Tested {ProdDebug} on {Pixel 2} with API level {33}.
Screenshots (for UI changes only)
Need help? See https://support.google.com/android/answer/9075928
Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.