Skip to content

Commit

Permalink
make sure the available in language label is translated to the app la…
Browse files Browse the repository at this point in the history
…nguage
  • Loading branch information
frett committed Oct 19, 2023
1 parent 705d279 commit 61822ff
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import org.cru.godtools.R
import org.cru.godtools.base.LocalAppLanguage
import org.cru.godtools.model.Language
import org.cru.godtools.model.Translation

Expand Down Expand Up @@ -58,8 +59,9 @@ internal fun AvailableInLanguage(
horizontalArrangement = horizontalArrangement,
modifier = modifier.widthIn(min = 50.dp)
) {
val appLanguage = LocalAppLanguage.current
val context = LocalContext.current
val name = remember(language, context) { language?.getDisplayName(context).orEmpty() }
val name = remember(language, context, appLanguage) { language?.getDisplayName(context, appLanguage).orEmpty() }

Text(
if (available) name else stringResource(R.string.tool_card_label_language_unavailable, name),
Expand Down

0 comments on commit 61822ff

Please sign in to comment.