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:
@@ -55,7 +55,7 @@ import eu.kanade.tachiyomi.data.track.Tracker
|
||||
import eu.kanade.tachiyomi.ui.manga.track.TrackItem
|
||||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.i18n.stringResource
|
||||
import java.text.DateFormat
|
||||
|
||||
private const val UnsetStatusTextAlpha = 0.5F
|
||||
@@ -194,7 +194,7 @@ private fun TrackInfoItem(
|
||||
Row(modifier = Modifier.height(IntrinsicSize.Min)) {
|
||||
TrackDetailsItem(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = status?.let { localize(it) } ?: "",
|
||||
text = status?.let { stringResource(it) } ?: "",
|
||||
onClick = onStatusClick,
|
||||
)
|
||||
VerticalDivider()
|
||||
@@ -209,7 +209,7 @@ private fun TrackInfoItem(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.alpha(if (score == null) UnsetStatusTextAlpha else 1f),
|
||||
text = score ?: localize(MR.strings.score),
|
||||
text = score ?: stringResource(MR.strings.score),
|
||||
onClick = onScoreClick,
|
||||
)
|
||||
}
|
||||
@@ -221,14 +221,14 @@ private fun TrackInfoItem(
|
||||
TrackDetailsItem(
|
||||
modifier = Modifier.weight(1F),
|
||||
text = startDate,
|
||||
placeholder = localize(MR.strings.track_started_reading_date),
|
||||
placeholder = stringResource(MR.strings.track_started_reading_date),
|
||||
onClick = onStartDateClick,
|
||||
)
|
||||
VerticalDivider()
|
||||
TrackDetailsItem(
|
||||
modifier = Modifier.weight(1F),
|
||||
text = endDate,
|
||||
placeholder = localize(MR.strings.track_finished_reading_date),
|
||||
placeholder = stringResource(MR.strings.track_finished_reading_date),
|
||||
onClick = onEndDateClick,
|
||||
)
|
||||
}
|
||||
@@ -279,7 +279,7 @@ private fun TrackInfoItemEmpty(
|
||||
.padding(start = 16.dp)
|
||||
.weight(1f),
|
||||
) {
|
||||
Text(text = localize(MR.strings.add_tracking))
|
||||
Text(text = stringResource(MR.strings.add_tracking))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -294,7 +294,7 @@ private fun TrackInfoItemMenu(
|
||||
IconButton(onClick = { expanded = true }) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.MoreVert,
|
||||
contentDescription = localize(MR.strings.label_more),
|
||||
contentDescription = stringResource(MR.strings.label_more),
|
||||
)
|
||||
}
|
||||
DropdownMenu(
|
||||
@@ -302,14 +302,14 @@ private fun TrackInfoItemMenu(
|
||||
onDismissRequest = { expanded = false },
|
||||
) {
|
||||
DropdownMenuItem(
|
||||
text = { Text(localize(MR.strings.action_open_in_browser)) },
|
||||
text = { Text(stringResource(MR.strings.action_open_in_browser)) },
|
||||
onClick = {
|
||||
onOpenInBrowser()
|
||||
expanded = false
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text(localize(MR.strings.action_remove)) },
|
||||
text = { Text(stringResource(MR.strings.action_remove)) },
|
||||
onClick = {
|
||||
onRemoved()
|
||||
expanded = false
|
||||
|
||||
@@ -41,7 +41,7 @@ import tachiyomi.presentation.core.components.WheelNumberPicker
|
||||
import tachiyomi.presentation.core.components.WheelTextPicker
|
||||
import tachiyomi.presentation.core.components.material.AlertDialogContent
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.i18n.stringResource
|
||||
import tachiyomi.presentation.core.util.isScrolledToEnd
|
||||
import tachiyomi.presentation.core.util.isScrolledToStart
|
||||
|
||||
@@ -54,7 +54,7 @@ fun TrackStatusSelector(
|
||||
onDismissRequest: () -> Unit,
|
||||
) {
|
||||
BaseSelector(
|
||||
title = localize(MR.strings.status),
|
||||
title = stringResource(MR.strings.status),
|
||||
content = {
|
||||
val state = rememberLazyListState()
|
||||
ScrollbarLazyColumn(state = state) {
|
||||
@@ -77,7 +77,7 @@ fun TrackStatusSelector(
|
||||
onClick = null,
|
||||
)
|
||||
Text(
|
||||
text = value?.let { localize(it) } ?: "",
|
||||
text = value?.let { stringResource(it) } ?: "",
|
||||
style = MaterialTheme.typography.bodyLarge.merge(),
|
||||
modifier = Modifier.padding(start = 24.dp),
|
||||
)
|
||||
@@ -102,7 +102,7 @@ fun TrackChapterSelector(
|
||||
onDismissRequest: () -> Unit,
|
||||
) {
|
||||
BaseSelector(
|
||||
title = localize(MR.strings.chapters),
|
||||
title = stringResource(MR.strings.chapters),
|
||||
content = {
|
||||
WheelNumberPicker(
|
||||
items = range.toImmutableList(),
|
||||
@@ -125,7 +125,7 @@ fun TrackScoreSelector(
|
||||
onDismissRequest: () -> Unit,
|
||||
) {
|
||||
BaseSelector(
|
||||
title = localize(MR.strings.score),
|
||||
title = stringResource(MR.strings.score),
|
||||
content = {
|
||||
WheelTextPicker(
|
||||
items = selections,
|
||||
@@ -172,15 +172,15 @@ fun TrackDateSelector(
|
||||
) {
|
||||
if (onRemove != null) {
|
||||
TextButton(onClick = onRemove) {
|
||||
Text(text = localize(MR.strings.action_remove))
|
||||
Text(text = stringResource(MR.strings.action_remove))
|
||||
}
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
}
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = localize(MR.strings.action_cancel))
|
||||
Text(text = stringResource(MR.strings.action_cancel))
|
||||
}
|
||||
TextButton(onClick = { onConfirm(pickerState.selectedDateMillis!!) }) {
|
||||
Text(text = localize(MR.strings.action_ok))
|
||||
Text(text = stringResource(MR.strings.action_ok))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,10 +215,10 @@ private fun BaseSelector(
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
}
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = localize(MR.strings.action_cancel))
|
||||
Text(text = stringResource(MR.strings.action_cancel))
|
||||
}
|
||||
TextButton(onClick = onConfirm) {
|
||||
Text(text = localize(MR.strings.action_ok))
|
||||
Text(text = stringResource(MR.strings.action_ok))
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -65,7 +65,7 @@ import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.ScrollbarLazyColumn
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.i18n.stringResource
|
||||
import tachiyomi.presentation.core.screens.EmptyScreen
|
||||
import tachiyomi.presentation.core.screens.LoadingScreen
|
||||
import tachiyomi.presentation.core.util.plus
|
||||
@@ -120,7 +120,7 @@ fun TrackerSearch(
|
||||
decorationBox = {
|
||||
if (query.text.isEmpty()) {
|
||||
Text(
|
||||
text = localize(MR.strings.action_search_hint),
|
||||
text = stringResource(MR.strings.action_search_hint),
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
)
|
||||
@@ -163,7 +163,7 @@ fun TrackerSearch(
|
||||
.fillMaxWidth(),
|
||||
elevation = ButtonDefaults.elevatedButtonElevation(),
|
||||
) {
|
||||
Text(text = localize(MR.strings.action_track))
|
||||
Text(text = stringResource(MR.strings.action_track))
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -204,7 +204,7 @@ fun TrackerSearch(
|
||||
EmptyScreen(
|
||||
modifier = Modifier.padding(innerPadding),
|
||||
message = queryResult.exceptionOrNull()?.message
|
||||
?: localize(MR.strings.unknown_error),
|
||||
?: stringResource(MR.strings.unknown_error),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -263,19 +263,19 @@ private fun SearchResultItem(
|
||||
)
|
||||
if (type.isNotBlank()) {
|
||||
SearchResultItemDetails(
|
||||
title = localize(MR.strings.track_type),
|
||||
title = stringResource(MR.strings.track_type),
|
||||
text = type,
|
||||
)
|
||||
}
|
||||
if (startDate.isNotBlank()) {
|
||||
SearchResultItemDetails(
|
||||
title = localize(MR.strings.label_started),
|
||||
title = stringResource(MR.strings.label_started),
|
||||
text = startDate,
|
||||
)
|
||||
}
|
||||
if (status.isNotBlank()) {
|
||||
SearchResultItemDetails(
|
||||
title = localize(MR.strings.track_status),
|
||||
title = stringResource(MR.strings.track_status),
|
||||
text = status,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user