apps-android-commons
apps-android-commons copied to clipboard
#5341 When the app language sets to French and OS language sets to Chinese,…
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.
Would you mind rebasing (or pulling) from the main branch? Thanks! :-)
Yes, finish pulling from main branch
I just updated all changes requested now. Ready to review :)
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 :-)