Skip to content

Commit

Permalink
Fix #3844: Combine chapter listing double string to one string (#4903)
Browse files Browse the repository at this point in the history
<!-- READ ME FIRST: Please fill in the explanation section below and
check off every point from the Essential Checklist! -->
## Explanation
<!--
- Explain what your PR does. If this PR fixes an existing bug, please
include
- "Fixes #bugnum:" in the explanation so that GitHub can auto-close the
issue
  - when this PR is merged.
  -->
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](#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
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [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 <[email protected]>
  • Loading branch information
kkmurerwa and BenHenning authored Apr 11, 2023
1 parent 0baeeb1 commit 4a14b41
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@
<string name="size_gb">%s ج.ب</string>
<string name="correct">صحيح!</string>
<string name="topic_prefix">الموضوع: %s</string>
<string name="chapter_count_with_story_name">%1$s في %2$s</string>
<plurals name="chapter_count">
<item quantity="zero">و لا فصل</item>
<item quantity="one">فصلًا واحدًا</item>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
<string name="size_gb">%s GB</string>
<string name="correct">Correto!</string>
<string name="topic_prefix">Tópico: %s</string>
<string name="chapter_count_with_story_name">%1$s em %2$s</string>
<plurals name="chapter_count">
<item quantity="one">1 Capítulo\n </item>
<item quantity="other">\n %s Capítulos\n </item>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-sw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
<string name="size_gb">%s GB</string>
<string name="correct">Sahihi!</string>
<string name="topic_prefix">Mada: %s</string>
<string name="chapter_count_with_story_name">%1$s katika %2$s</string>
<plurals name="chapter_count">
<item quantity="one">Sura 1</item>
<item quantity="other">Sura %s</item>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@
<string name="correct">Correct!</string>
<string name="topic_prefix">Topic: %s</string>
<string name="welcome_profile_name">%s!</string>
<string name="chapter_count_with_story_name">%1$s in %2$s</string>
<plurals name="chapter_count">
<item quantity="one">
1 Chapter
Expand Down

0 comments on commit 4a14b41

Please sign in to comment.