From 4a14b415a4fba74a415e9fa4427d37a585a55569 Mon Sep 17 00:00:00 2001 From: Kenneth Murerwa Date: Tue, 11 Apr 2023 09:37:10 +0300 Subject: [PATCH] Fix #3844: Combine chapter listing double string to one string (#4903) ## Explanation Fix #3844: When merged, this PR will; - Remove the `R.plurals.chapter_count_with_story_name` from the strings file. - Remove all translations of the `R.plurals.chapter_count_with_story_name`. - Delete the `computeStoryNameChapterCountContainerContentDescription()` method from `StorySummaryViewModel` which is no longer used. The approach to delete the above files was necessitated by a change made on [PR #4441](https://github.com/oppia/oppia-android/pull/4441). The PR switched from a chapter-based progress system i.e. _Chapter 1 of 10_ to a percentage-based progress system. This made the `chapter_count_with_story_name` strings and the `computeStoryNameChapterCountContainerContentDescription()` method used to generate the chapter-based progress text redundant. These have been removed to eliminate this redundancy. ## 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)). --------- Co-authored-by: Ben Henning --- .../app/topic/lessons/StorySummaryViewModel.kt | 11 ----------- app/src/main/res/values-ar/strings.xml | 1 - app/src/main/res/values-pt-rBR/strings.xml | 1 - app/src/main/res/values-sw/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 5 files changed, 15 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/topic/lessons/StorySummaryViewModel.kt b/app/src/main/java/org/oppia/android/app/topic/lessons/StorySummaryViewModel.kt index c57d89db6a2..c831d6a79fe 100644 --- a/app/src/main/java/org/oppia/android/app/topic/lessons/StorySummaryViewModel.kt +++ b/app/src/main/java/org/oppia/android/app/topic/lessons/StorySummaryViewModel.kt @@ -41,17 +41,6 @@ class StorySummaryViewModel( storyProgressPercentageText.set(computeStoryProgressPercentageText(storyPercentage)) } - fun computeStoryNameChapterCountContainerContentDescription(): String { - // TODO(#3844): Combine these strings together. - val chapterCountText = - resourceHandler.getQuantityStringInLocaleWithWrapping( - R.plurals.chapter_count, storySummary.chapterCount, storySummary.chapterCount.toString() - ) - return resourceHandler.getStringInLocaleWithWrapping( - R.string.chapter_count_with_story_name, chapterCountText, storyTitle - ) - } - fun computeChapterCountText(): String { return resourceHandler.getQuantityStringInLocaleWithWrapping( R.plurals.chapter_count, storySummary.chapterCount, storySummary.chapterCount.toString() diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 8603c370b15..96bd0d65f17 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -178,7 +178,6 @@ %s ج.ب صحيح! الموضوع: %s - %1$s في %2$s و لا فصل فصلًا واحدًا diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index a4d45ad6f74..f32c1017c0f 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -172,7 +172,6 @@ %s GB Correto! Tópico: %s - %1$s em %2$s 1 Capítulo\n \n %s Capítulos\n diff --git a/app/src/main/res/values-sw/strings.xml b/app/src/main/res/values-sw/strings.xml index 68f87fd364f..8a153aa5814 100644 --- a/app/src/main/res/values-sw/strings.xml +++ b/app/src/main/res/values-sw/strings.xml @@ -164,7 +164,6 @@ %s GB Sahihi! Mada: %s - %1$s katika %2$s Sura 1 Sura %s diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 285134c0ef9..90afd13dfc2 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -186,7 +186,6 @@ Correct! Topic: %s %s! - %1$s in %2$s 1 Chapter