resolve conflicts but new issue found when changing the language

This commit is contained in:
Rashed
2023-03-01 07:54:27 +03:00
parent 5eb3b2062c
commit 67e6349877
3 changed files with 4 additions and 4 deletions
@@ -16,9 +16,9 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.ui.actions.NewChannelView import com.vitorpamplona.amethyst.ui.actions.NewChannelView
@@ -24,7 +24,7 @@ fun timeAgo(mills: Long?, context : Context): String {
.replace(" days ago", context.getString(R.string.d)) .replace(" days ago", context.getString(R.string.d))
} }
fun timeAgoShort(mills: Long?): String { fun timeAgoShort(mills: Long?, context: Context): String {
if (mills == null) return " " if (mills == null) return " "
var humanReadable = DateUtils.getRelativeTimeSpanString( var humanReadable = DateUtils.getRelativeTimeSpanString(
@@ -34,7 +34,7 @@ fun timeAgoShort(mills: Long?): String {
DateUtils.FORMAT_ABBREV_ALL DateUtils.FORMAT_ABBREV_ALL
).toString() ).toString()
if (humanReadable.startsWith("In") || humanReadable.startsWith("0")) { if (humanReadable.startsWith("In") || humanReadable.startsWith("0")) {
humanReadable = "now"; humanReadable = context.getString(R.string.now);
} }
return humanReadable return humanReadable