[PR #4849] [MERGED] PM-18877 Respect system app specific language selection on Android 13 and up. #5256

Closed
opened 2025-11-26 23:56:30 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4849
Author: @dseverns-livefront
Created: 3/11/2025
Status: Merged
Merged: 3/13/2025
Merged by: @dseverns-livefront

Base: mainHead: PM-18877-respect-app-specific-language


📝 Commits (1)

  • 528f4a9 PM-18877 check API when app resumes and set stored local value accordingly

📊 Changes

7 files changed (+161 additions, -28 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/MainActivity.kt (+29 -5)
📝 app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt (+13 -1)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceViewModel.kt (+35 -1)
app/src/main/java/com/x8bit/bitwarden/ui/platform/util/LocaleExtensions.kt (+13 -0)
📝 app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt (+10 -0)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceViewModelTest.kt (+27 -21)
app/src/test/java/com/x8bit/bitwarden/ui/platform/util/LocaleExtensionsTest.kt (+34 -0)

📄 Description

🎟️ Tracking

#4813
#4833
PM-18877

📔 Objective

  • When a user makes a selection for an app specific language through the device settings (Android 13+), we want to respect that setting and update the internal storage to reflect those changes.
  • If the user sets an app specific language from the device settings currently, that selection will not be persisted across app restart as it was not being saved.
  • There was also a case where, if the user had set a language in the app's appearance settings and then made a new selection in the device settings it would not be reflected.
  • For devices where App specific language APIs are available we will check the API when the app resumes and if one is selected we will save to the storage to keep in sync.

📸 Screenshots

BEFORE

https://github.com/user-attachments/assets/a15ef916-b38b-4926-a4bf-9e370f3059f9

AFTER

https://github.com/user-attachments/assets/1ceb832e-ca42-4398-be62-3afa00f297b0

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/4849 **Author:** [@dseverns-livefront](https://github.com/dseverns-livefront) **Created:** 3/11/2025 **Status:** ✅ Merged **Merged:** 3/13/2025 **Merged by:** [@dseverns-livefront](https://github.com/dseverns-livefront) **Base:** `main` ← **Head:** `PM-18877-respect-app-specific-language` --- ### 📝 Commits (1) - [`528f4a9`](https://github.com/bitwarden/android/commit/528f4a91bf80b469a93aa16fb392d026ae15c0fd) PM-18877 check API when app resumes and set stored local value accordingly ### 📊 Changes **7 files changed** (+161 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/MainActivity.kt` (+29 -5) 📝 `app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt` (+13 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceViewModel.kt` (+35 -1) ➕ `app/src/main/java/com/x8bit/bitwarden/ui/platform/util/LocaleExtensions.kt` (+13 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt` (+10 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceViewModelTest.kt` (+27 -21) ➕ `app/src/test/java/com/x8bit/bitwarden/ui/platform/util/LocaleExtensionsTest.kt` (+34 -0) </details> ### 📄 Description ## 🎟️ Tracking #4813 #4833 [PM-18877](https://bitwarden.atlassian.net/browse/PM-18877) <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective - When a user makes a selection for an app specific language through the device settings (Android 13+), we want to respect that setting and update the internal storage to reflect those changes. - If the user sets an app specific language from the device settings currently, that selection will not be persisted across app restart as it was not being saved. - There was also a case where, if the user had set a language in the app's appearance settings and then made a new selection in the device settings it would not be reflected. - For devices where App specific language APIs are available we will check the API when the app resumes and if one is selected we will save to the storage to keep in sync. <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> ## 📸 Screenshots # BEFORE https://github.com/user-attachments/assets/a15ef916-b38b-4926-a4bf-9e370f3059f9 # AFTER https://github.com/user-attachments/assets/1ceb832e-ca42-4398-be62-3afa00f297b0 <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes [PM-18877]: https://bitwarden.atlassian.net/browse/PM-18877?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:56:30 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5256