mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-29 20:47:50 +02:00
Replace remaining Android-specific strings
Also renaming the helper composables so it's a bit easier to find/replace everything in forks.
This commit is contained in:
@ -47,7 +47,7 @@ import tachiyomi.core.preference.Preference
|
||||
import tachiyomi.core.preference.TriState
|
||||
import tachiyomi.core.preference.toggle
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.i18n.stringResource
|
||||
import tachiyomi.presentation.core.theme.header
|
||||
import tachiyomi.presentation.core.util.collectAsState
|
||||
|
||||
@ -58,7 +58,7 @@ object SettingsItemsPaddings {
|
||||
|
||||
@Composable
|
||||
fun HeadingItem(labelRes: StringResource) {
|
||||
HeadingItem(localize(labelRes))
|
||||
HeadingItem(stringResource(labelRes))
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
@ -5,29 +5,29 @@ import androidx.compose.runtime.ReadOnlyComposable
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import dev.icerock.moko.resources.PluralsResource
|
||||
import dev.icerock.moko.resources.StringResource
|
||||
import tachiyomi.core.i18n.localize
|
||||
import tachiyomi.core.i18n.localizePlural
|
||||
import tachiyomi.core.i18n.pluralStringResource
|
||||
import tachiyomi.core.i18n.stringResource
|
||||
|
||||
@Composable
|
||||
@ReadOnlyComposable
|
||||
fun localize(resource: StringResource): String {
|
||||
return LocalContext.current.localize(resource)
|
||||
fun stringResource(resource: StringResource): String {
|
||||
return LocalContext.current.stringResource(resource)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@ReadOnlyComposable
|
||||
fun localize(resource: StringResource, vararg args: Any): String {
|
||||
return LocalContext.current.localize(resource, *args)
|
||||
fun stringResource(resource: StringResource, vararg args: Any): String {
|
||||
return LocalContext.current.stringResource(resource, *args)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@ReadOnlyComposable
|
||||
fun localizePlural(resource: PluralsResource, count: Int): String {
|
||||
return LocalContext.current.localizePlural(resource, count)
|
||||
fun pluralStringResource(resource: PluralsResource, count: Int): String {
|
||||
return LocalContext.current.pluralStringResource(resource, count)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@ReadOnlyComposable
|
||||
fun localizePlural(resource: PluralsResource, count: Int, vararg args: Any): String {
|
||||
return LocalContext.current.localizePlural(resource, count, *args)
|
||||
fun pluralStringResource(resource: PluralsResource, count: Int, vararg args: Any): String {
|
||||
return LocalContext.current.pluralStringResource(resource, count, *args)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import dev.icerock.moko.resources.StringResource
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import tachiyomi.presentation.core.components.ActionButton
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.i18n.stringResource
|
||||
import tachiyomi.presentation.core.util.secondaryItemAlpha
|
||||
import kotlin.random.Random
|
||||
|
||||
@ -42,7 +42,7 @@ fun EmptyScreen(
|
||||
actions: ImmutableList<EmptyScreenAction>? = null,
|
||||
) {
|
||||
EmptyScreen(
|
||||
message = localize(stringRes),
|
||||
message = stringResource(stringRes),
|
||||
modifier = modifier,
|
||||
actions = actions,
|
||||
)
|
||||
@ -89,7 +89,7 @@ fun EmptyScreen(
|
||||
actions.fastForEach {
|
||||
ActionButton(
|
||||
modifier = Modifier.weight(1f),
|
||||
title = localize(it.stringRes),
|
||||
title = stringResource(it.stringRes),
|
||||
icon = it.icon,
|
||||
onClick = it.onClick,
|
||||
)
|
||||
|
Reference in New Issue
Block a user