From 8da00f74be9906b0d13a176eb8a6a7d910047f84 Mon Sep 17 00:00:00 2001 From: KingLucius Date: Tue, 27 Feb 2024 14:21:06 +0200 Subject: [PATCH] Localized secondsToReadable fun --- .../lagradost/cloudstream3/syncproviders/AccountManager.kt | 6 +++++- app/src/main/res/values/strings.xml | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/AccountManager.kt b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/AccountManager.kt index bae8a5df..a9c23ac3 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/AccountManager.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/AccountManager.kt @@ -1,8 +1,10 @@ package com.lagradost.cloudstream3.syncproviders +import com.lagradost.cloudstream3.AcraApplication.Companion.context import com.lagradost.cloudstream3.AcraApplication.Companion.getKey import com.lagradost.cloudstream3.AcraApplication.Companion.removeKeys import com.lagradost.cloudstream3.AcraApplication.Companion.setKey +import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.syncproviders.providers.SubScene import com.lagradost.cloudstream3.syncproviders.providers.* import java.util.concurrent.TimeUnit @@ -81,7 +83,9 @@ abstract class AccountManager(private val defIndex: Int) : AuthAPI { return completedValue } //println("$days $hours $minutes") - return "${if (days != 0L) "$days" + "d " else ""}${if (hours != 0L) "$hours" + "h " else ""}${minutes}m" + return "${if (days != 0L) "$days" + "${context?.getString(R.string.days_short)} " else ""}${if (hours != 0L) "$hours" + + "${context?.getString(R.string.hours_short)} " else ""}${minutes}${context?.getString(R.string.mins_short)}" + } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9738ae9c..e2248f2f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -306,7 +306,11 @@ +30 This will permanently delete %s\nAre you sure? %dm\nremaining + %s\nremaining Ongoing + d + h + m Completed Status Year