From 90777d778286cb2f79bb6b7c44ba04cb9dab15ab Mon Sep 17 00:00:00 2001 From: Ferdy Rodriguez Date: Wed, 29 May 2024 16:18:25 +0200 Subject: [PATCH] testing log in test --- .../java/org/dhis2/commons/date/DateExtensions.kt | 1 + .../org/dhis2/commons/resources/ResourceManager.kt | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/commons/src/main/java/org/dhis2/commons/date/DateExtensions.kt b/commons/src/main/java/org/dhis2/commons/date/DateExtensions.kt index 1e063bdb9d..a5f82c9bdd 100644 --- a/commons/src/main/java/org/dhis2/commons/date/DateExtensions.kt +++ b/commons/src/main/java/org/dhis2/commons/date/DateExtensions.kt @@ -153,6 +153,7 @@ private fun getString( duration: Int, isOverdue: Boolean = true, ): String { + println("Ferdy is overdue: $isOverdue") return resourceManager.getPlural( if (isOverdue) overduePluralResource else scheduledPluralResource, duration, diff --git a/commons/src/main/java/org/dhis2/commons/resources/ResourceManager.kt b/commons/src/main/java/org/dhis2/commons/resources/ResourceManager.kt index f27112002b..80cd843e47 100644 --- a/commons/src/main/java/org/dhis2/commons/resources/ResourceManager.kt +++ b/commons/src/main/java/org/dhis2/commons/resources/ResourceManager.kt @@ -27,8 +27,18 @@ class ResourceManager( fun getPlural(@PluralsRes pluralResource: Int, quantity: Int) = getWrapperContext().resources.getQuantityString(pluralResource, quantity) - fun getPlural(@PluralsRes pluralResource: Int, quantity: Int, vararg arguments: Any) = - getWrapperContext().resources.getQuantityString(pluralResource, quantity, *arguments) + fun getPlural(@PluralsRes pluralResource: Int, quantity: Int, vararg arguments: Any) : String? { + println( + "Ferdy getPlural: ${ + getWrapperContext().resources.getQuantityString( + pluralResource, + quantity, + *arguments + ) + }" + ) + return getWrapperContext().resources.getQuantityString(pluralResource, quantity, *arguments) + } fun formatWithEnrollmentLabel( programUid: String?,