Skip to content
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

Remove in-app language pref #21542

Merged
merged 15 commits into from
Dec 20, 2024

Conversation

nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Dec 17, 2024

This PR removes the in-app language shared preference, so we now rely on the system's per-app language preference. I also removed the various calls to setLocale throughout the app since that's now handled by the system.

Note that for now LocaleManager.getLanguage() simply calls PerAppLocaleManager to get the current language code. This was to avoid replacing all the calls to LocaleManager.getLanguage() throughout the app. I will address that in a subsequent PR because I didn't want to make this one any larger than it is.

Also note that there's still more cleanup to do, but once this PR is merged I think we're good to merge the feature branch and I can handle the remaining cleanup separately.

@nbradbury nbradbury changed the base branch from trunk to feature/per-app-language-prefs December 17, 2024 20:28
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 17, 2024

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21542-6c20c6a
Commit6c20c6a
Direct Downloadjetpack-prototype-build-pr21542-6c20c6a.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 17, 2024

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21542-6c20c6a
Commit6c20c6a
Direct Downloadwordpress-prototype-build-pr21542-6c20c6a.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 39.48%. Comparing base (a286185) to head (6c20c6a).
Report is 19 commits behind head on feature/per-app-language-prefs.

Files with missing lines Patch % Lines
...s/android/push/NotificationsProcessingService.java 0.00% 1 Missing ⚠️
.../org/wordpress/android/ui/prefs/AppPrefsWrapper.kt 0.00% 1 Missing ⚠️
...d/ui/reader/services/update/ReaderUpdateLogic.java 0.00% 1 Missing ⚠️
...org/wordpress/android/util/LocaleManagerWrapper.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##           feature/per-app-language-prefs   #21542   +/-   ##
===============================================================
  Coverage                           39.48%   39.48%           
===============================================================
  Files                                2117     2117           
  Lines                               99464    99464           
  Branches                            15296    15296           
===============================================================
  Hits                                39269    39269           
  Misses                              56714    56714           
  Partials                             3481     3481           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nbradbury nbradbury changed the title Nick/remove language pref Remove in-app language pref Dec 19, 2024
@nbradbury nbradbury marked this pull request as ready for review December 19, 2024 14:13
@nbradbury nbradbury requested review from ParaskP7 and wzieba December 19, 2024 14:13
Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @nbradbury !

I have reviewed this PR as per the instructions (also tested it), everything works as expected, this is a good clean-up, we're almost there! 🎉


I have left few questions (❓) and a couple of suggestions (💡) for you to consider. I am going to approve this PR anyway, since none is blocking. I am NOT going to merge this PR yet to give you some time to apply any of my suggestions. However, feel free to ignore them and merge the PR yourself.


EXTRAS

  1. Question (❓): On Cleanup LocaleManager #21541 I left a comment about this val split and via your reply here I understood that this might also be removed in this PR and prior us merging to trunk, thus no point discussing back then. But, if that won't happen, can we discuss that once more, so I undertand why the Java code got transformed to this version of Kotlin code. 🙏
  2. Suggestion (💡): I am not trying to be pedantic here, honestly I don't want to, please take this with a grain of salt; when creating a commit message, please consider providing a reason for a change (commit description), that is, in addition to describing what this commit does, which you do do (commit title). I am only asking that, because it would make me more effective in reviewing the changes as I would understand the why of the change in detail, the reasoning behind that, not only the how (example). 🙏

@nbradbury
Copy link
Contributor Author

please take this with a grain of salt; when creating a commit message, please consider providing a reason for a change (commit description), that is, in addition to describing what this commit does,

That's a very fair comment, I'll do this going forward.

@nbradbury
Copy link
Contributor Author

  1. can we discuss that once more, so I undertand why the Java code got transformed to this version of Kotlin code. 🙏

Apologies, I dropped the ball on that one. I just corrected it in 6c20c6a.

@ParaskP7
Copy link
Contributor

Apologies, I dropped the ball on that one. I just corrected it in 6c20c6a.

Oh, awesome, thanks Nick, so all the below got somehow added during the Java-to-Kotlin conversion automagically? 🤔 😨

                      ...toRegex())
                .dropLastWhile { it.isEmpty() }
                .toTypedArray()

@nbradbury
Copy link
Contributor Author

so all the below got somehow added during the Java-to-Kotlin conversion automagically?

It did, surprisingly!

@nbradbury nbradbury merged commit e12ec43 into feature/per-app-language-prefs Dec 20, 2024
22 checks passed
@nbradbury nbradbury deleted the nick/remove-language-pref branch December 20, 2024 14:25
@nbradbury nbradbury mentioned this pull request Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants