forked from oppia/oppia-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes part of oppia#4938: Use TranslationController as the source of …
…truth for the audio language setting (oppia#5487) ## Explanation Fixes part of oppia#4938 This primarily updates ``ProfileManagementController`` to use ``TranslationController`` as the source of truth for audio language (rather than using the audio language property stored within the ``Profile`` proto). This has some noteworthy advantages: - It allows for proper translation setting fallback behaviors to be enabled for the audio language setting without needing to migrate UI code over to ``TranslationController``. - It isolates changes to the domain layer (with one exception: reading the audio language setting now uses a new getter in ``ProfileManagementController`` rather than reading the profile directly). Some peripheral changes were also needed as part of this: - A bunch of tests needed to be disabled in Gradle now that different options UIs (including for reading text) may depend on ``TranslationController`` (which is only fully configured in Bazel builds). - The ``Profile`` proto was updated to remove its audio language setting. This means that existing users will revert back to whichever default ``TranslationController`` decides for them (most likely English, but it depends on several factors). This is considered a reasonable regression since most users are unlikely to depend on the automatic audio language setting, and the app is currently in a beta state so regressions like this should be expected. - French and Chinese were removed from the list of ``AudioLanguage``s since they are not currently supported by the Oppia Android app (per ``OppiaLanguage`` which, plus the configured supported language textproto files, determine for which languages the app is guaranteeing support). - ``ProfileManagementControllerTest`` was updated to have much more thorough testing around audio language. - ``TranslationController`` was updated to use a ``PersistentCacheStore`` backing for audio and written translation languages (in addition to app language which was already supported). - As part of the previous change, ``TranslationController.updateAppLanguage()`` and its related tests were updated to verify the _previous_ language is returned, not the current (for consistency with voiceover and written translations). Long-term, ``AudioLanguage`` should be removed (along with its corresponding functionality in ``ProfileManagementController``) in favor of using ``TranslationController`` and ``OppiaLocale`` as the bases for managing language functionality in the UI layer. Note that the Gradle version of the app will have increased degraded functionality in the options menu due to no supported language configuration being included in the build for that app (see the corresponding comment thread in this PR for more context). This is considered a reasonable medium-term gap as developers ought to be using the Bazel build of the app, anyway, as the Gradle version has significant functional limitations for all aspects of language selection and management (due to the lack of language configuration). ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only Options screen (without changes): ![image](https://github.com/user-attachments/assets/065caa9f-5815-42a5-98ec-278186fa8dcd) Options screen (with changes): ![image](https://github.com/user-attachments/assets/f4ece283-bf0e-4490-a1bb-57e77bb7a834) I also verified setting a profile audio setting (Portuguese) on a ``develop`` branch build and then upgrading to a build from this branch. There are no crashes or stability issues, and (per my device setup) the audio language does revert back to English as expected. I also verified that, like before, the audio setting persists across app instances when changed and is distinct between multiple profiles.
- Loading branch information
1 parent
1c6c9f7
commit 02eadc1
Showing
13 changed files
with
341 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.