From 1231eed674b962f0bae400db7140d4365a6caf28 Mon Sep 17 00:00:00 2001 From: Aayushi Mathur Date: Sat, 16 Sep 2023 23:52:47 +0530 Subject: [PATCH 1/4] "added time_ago in plurals" --- .../databinding/TextViewBindingAdapters.java | 6 +++--- app/src/main/res/values/strings.xml | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/databinding/TextViewBindingAdapters.java b/app/src/main/java/org/oppia/android/app/databinding/TextViewBindingAdapters.java index 349c680f221..4286e54565f 100644 --- a/app/src/main/java/org/oppia/android/app/databinding/TextViewBindingAdapters.java +++ b/app/src/main/java/org/oppia/android/app/databinding/TextViewBindingAdapters.java @@ -83,13 +83,13 @@ private static String getTimeAgo(View view, long lastVisitedTimestamp) { } else if (timeDifferenceMillis < TimeUnit.MINUTES.toMillis(50)) { return getPluralString( resourceHandler, - R.plurals.minutes, + R.plurals.minutes_ago, (int) TimeUnit.MILLISECONDS.toMinutes(timeDifferenceMillis) ); } else if (timeDifferenceMillis < TimeUnit.DAYS.toMillis(1)) { return getPluralString( resourceHandler, - R.plurals.hours, + R.plurals.hours_ago, (int) TimeUnit.MILLISECONDS.toHours(timeDifferenceMillis) ); } else if (timeDifferenceMillis < TimeUnit.DAYS.toMillis(2)) { @@ -97,7 +97,7 @@ private static String getTimeAgo(View view, long lastVisitedTimestamp) { } return getPluralString( resourceHandler, - R.plurals.days, + R.plurals.days_ago, (int) TimeUnit.MILLISECONDS.toDays(timeDifferenceMillis) ); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 408a4095aca..1eca7c1b14f 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -481,17 +481,18 @@ Up Down %s %s - - a minute - %s minutes + + zero minutes ago + a minute ago + %s minutes ago - - an hour - %s hours + + an hour ago + %s hours ago - - a day - %s days + + a day ago + %s days ago topic_revision_recyclerview_tag From dbb8a5ea41263a052de33e8e202b30fcd8f1c493 Mon Sep 17 00:00:00 2001 From: Aayushi Mathur Date: Tue, 19 Sep 2023 18:54:50 +0530 Subject: [PATCH 2/4] checking by making minor changes --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1eca7c1b14f..a9c99136bc4 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -468,7 +468,7 @@ just now recently - %s ago + %s yesterday Return to topic Return to lesson From b68ac786cc7954a878879404745520a2ba2c1c78 Mon Sep 17 00:00:00 2001 From: Aayushi Mathur Date: Tue, 19 Sep 2023 20:26:52 +0530 Subject: [PATCH 3/4] changed plural zero quantity --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a9c99136bc4..f5e3bacaba0 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -482,7 +482,7 @@ Down %s %s - zero minutes ago + 0 minute ago a minute ago %s minutes ago From aa3818455057676330c411b6720c7e3a5766224a Mon Sep 17 00:00:00 2001 From: Aayushi Mathur Date: Thu, 21 Sep 2023 15:30:11 +0530 Subject: [PATCH 4/4] suggested changes --- .../android/app/databinding/TextViewBindingAdapters.java | 8 ++------ app/src/main/res/values/strings.xml | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/databinding/TextViewBindingAdapters.java b/app/src/main/java/org/oppia/android/app/databinding/TextViewBindingAdapters.java index 4286e54565f..591e8c88738 100644 --- a/app/src/main/java/org/oppia/android/app/databinding/TextViewBindingAdapters.java +++ b/app/src/main/java/org/oppia/android/app/databinding/TextViewBindingAdapters.java @@ -107,13 +107,9 @@ private static String getPluralString( @PluralsRes int pluralsResId, int count ) { - // TODO(#3841): Combine these strings together. - return resourceHandler.getStringInLocaleWithWrapping( - R.string.time_ago, - resourceHandler.getQuantityStringInLocaleWithWrapping( + return resourceHandler.getQuantityStringInLocaleWithWrapping( pluralsResId, count, String.valueOf(count) - ) - ); + ); } private static long ensureTimestampIsInMilliseconds(long lastVisitedTimestamp) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f5e3bacaba0..3f48fef86cc 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -468,7 +468,6 @@ just now recently - %s yesterday Return to topic Return to lesson @@ -482,7 +481,7 @@ Down %s %s - 0 minute ago + 0 minutes ago a minute ago %s minutes ago