From 7d1b932d603acef54c33d0a109eeb19d3bfae100 Mon Sep 17 00:00:00 2001 From: Nick Bradbury Date: Thu, 12 Dec 2024 10:43:55 -0500 Subject: [PATCH] Updated comments --- .../src/main/java/org/wordpress/android/AppInitializer.kt | 3 +-- .../main/java/org/wordpress/android/ui/LocaleAwareActivity.kt | 4 ++-- .../java/org/wordpress/android/util/PerAppLocaleManager.kt | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt b/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt index f4bc6eb1eca5..e3b7fb142355 100644 --- a/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt +++ b/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt @@ -950,8 +950,7 @@ class AppInitializer @Inject constructor( */ private inner class MemoryAndConfigChangeMonitor : ComponentCallbacks2 { override fun onConfigurationChanged(newConfig: Configuration) { - // If per-app locale is enabled make sure the in-app locale is correct, - // otherwise reapply in-app locale on configuration change + // Make sure the in-app locale is correct perAppLocaleManager.checkAndUpdateOldLanguagePrefKey() } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/LocaleAwareActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/LocaleAwareActivity.kt index 6e6507746610..15afe4f33862 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/LocaleAwareActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/LocaleAwareActivity.kt @@ -5,8 +5,8 @@ import android.content.res.Configuration import androidx.appcompat.app.AppCompatActivity /** - * Update Dec 2024: We've added experimental support for per-app language preferences which - * negate the need for this class. Instead of extending from this class, we should extend + * Update Dec 2024: We've added support for per-app language preferences which negate + * the need for this class. Instead of extending from this class, we should extend * from AppCompatActivity. */ abstract class LocaleAwareActivity : AppCompatActivity() { diff --git a/WordPress/src/main/java/org/wordpress/android/util/PerAppLocaleManager.kt b/WordPress/src/main/java/org/wordpress/android/util/PerAppLocaleManager.kt index edefcc22de66..822abcb43cf8 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/PerAppLocaleManager.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/PerAppLocaleManager.kt @@ -133,6 +133,7 @@ class PerAppLocaleManager @Inject constructor( return } + // Only update if the language is different if (languageCode.equals(getCurrentLocaleLanguageCode()).not()) { setCurrentLocaleByLanguageCode(languageCode) }