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:
arkon
2023-11-18 19:41:33 -05:00
parent 46e734fc8e
commit 0d1bced122
165 changed files with 1179 additions and 1167 deletions

View File

@@ -13,7 +13,7 @@ import dev.icerock.moko.resources.StringResource
import tachiyomi.core.preference.CheckboxState
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.LabeledCheckbox
import tachiyomi.presentation.core.i18n.localize
import tachiyomi.presentation.core.i18n.stringResource
@Composable
fun DeleteLibraryMangaDialog(
@@ -35,7 +35,7 @@ fun DeleteLibraryMangaDialog(
onDismissRequest = onDismissRequest,
dismissButton = {
TextButton(onClick = onDismissRequest) {
Text(text = localize(MR.strings.action_cancel))
Text(text = stringResource(MR.strings.action_cancel))
}
},
confirmButton = {
@@ -49,17 +49,17 @@ fun DeleteLibraryMangaDialog(
)
},
) {
Text(text = localize(MR.strings.action_ok))
Text(text = stringResource(MR.strings.action_ok))
}
},
title = {
Text(text = localize(MR.strings.action_remove))
Text(text = stringResource(MR.strings.action_remove))
},
text = {
Column {
list.forEach { state ->
LabeledCheckbox(
label = localize(state.value),
label = stringResource(state.value),
checked = state.isChecked,
onCheckedChange = {
val index = list.indexOf(state)

View File

@@ -30,7 +30,7 @@ import tachiyomi.presentation.core.components.SettingsChipRow
import tachiyomi.presentation.core.components.SliderItem
import tachiyomi.presentation.core.components.SortItem
import tachiyomi.presentation.core.components.TriStateItem
import tachiyomi.presentation.core.i18n.localize
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState
@Composable
@@ -42,9 +42,9 @@ fun LibrarySettingsDialog(
TabbedDialog(
onDismissRequest = onDismissRequest,
tabTitles = persistentListOf(
localize(MR.strings.action_filter),
localize(MR.strings.action_sort),
localize(MR.strings.action_display),
stringResource(MR.strings.action_filter),
stringResource(MR.strings.action_sort),
stringResource(MR.strings.action_display),
),
) { page ->
Column(
@@ -75,7 +75,7 @@ private fun ColumnScope.FilterPage(
val filterDownloaded by screenModel.libraryPreferences.filterDownloaded().collectAsState()
val downloadedOnly by screenModel.preferences.downloadedOnly().collectAsState()
TriStateItem(
label = localize(MR.strings.label_downloaded),
label = stringResource(MR.strings.label_downloaded),
state = if (downloadedOnly) {
TriState.ENABLED_IS
} else {
@@ -86,25 +86,25 @@ private fun ColumnScope.FilterPage(
)
val filterUnread by screenModel.libraryPreferences.filterUnread().collectAsState()
TriStateItem(
label = localize(MR.strings.action_filter_unread),
label = stringResource(MR.strings.action_filter_unread),
state = filterUnread,
onClick = { screenModel.toggleFilter(LibraryPreferences::filterUnread) },
)
val filterStarted by screenModel.libraryPreferences.filterStarted().collectAsState()
TriStateItem(
label = localize(MR.strings.label_started),
label = stringResource(MR.strings.label_started),
state = filterStarted,
onClick = { screenModel.toggleFilter(LibraryPreferences::filterStarted) },
)
val filterBookmarked by screenModel.libraryPreferences.filterBookmarked().collectAsState()
TriStateItem(
label = localize(MR.strings.action_filter_bookmarked),
label = stringResource(MR.strings.action_filter_bookmarked),
state = filterBookmarked,
onClick = { screenModel.toggleFilter(LibraryPreferences::filterBookmarked) },
)
val filterCompleted by screenModel.libraryPreferences.filterCompleted().collectAsState()
TriStateItem(
label = localize(MR.strings.completed),
label = stringResource(MR.strings.completed),
state = filterCompleted,
onClick = { screenModel.toggleFilter(LibraryPreferences::filterCompleted) },
)
@@ -118,7 +118,7 @@ private fun ColumnScope.FilterPage(
val service = trackers[0]
val filterTracker by screenModel.libraryPreferences.filterTracking(service.id.toInt()).collectAsState()
TriStateItem(
label = localize(MR.strings.action_filter_tracked),
label = stringResource(MR.strings.action_filter_tracked),
state = filterTracker,
onClick = { screenModel.toggleTracker(service.id.toInt()) },
)
@@ -163,7 +163,7 @@ private fun ColumnScope.SortPage(
MR.strings.action_sort_date_added to LibrarySort.Type.DateAdded,
).plus(trackerSortOption).map { (titleRes, mode) ->
SortItem(
label = localize(titleRes),
label = stringResource(titleRes),
sortDescending = sortDescending.takeIf { sortingMode == mode },
onClick = {
val isTogglingDirection = sortingMode == mode
@@ -202,7 +202,7 @@ private fun ColumnScope.DisplayPage(
FilterChip(
selected = displayMode == mode,
onClick = { screenModel.setDisplayMode(mode) },
label = { Text(localize(titleRes)) },
label = { Text(stringResource(titleRes)) },
)
}
}
@@ -219,13 +219,13 @@ private fun ColumnScope.DisplayPage(
val columns by columnPreference.collectAsState()
SliderItem(
label = localize(MR.strings.pref_library_columns),
label = stringResource(MR.strings.pref_library_columns),
max = 10,
value = columns,
valueText = if (columns > 0) {
localize(MR.strings.pref_library_columns_per_row, columns)
stringResource(MR.strings.pref_library_columns_per_row, columns)
} else {
localize(MR.strings.label_default)
stringResource(MR.strings.label_default)
},
onChange = columnPreference::set,
)
@@ -233,29 +233,29 @@ private fun ColumnScope.DisplayPage(
HeadingItem(MR.strings.overlay_header)
CheckboxItem(
label = localize(MR.strings.action_display_download_badge),
label = stringResource(MR.strings.action_display_download_badge),
pref = screenModel.libraryPreferences.downloadBadge(),
)
CheckboxItem(
label = localize(MR.strings.action_display_local_badge),
label = stringResource(MR.strings.action_display_local_badge),
pref = screenModel.libraryPreferences.localBadge(),
)
CheckboxItem(
label = localize(MR.strings.action_display_language_badge),
label = stringResource(MR.strings.action_display_language_badge),
pref = screenModel.libraryPreferences.languageBadge(),
)
CheckboxItem(
label = localize(MR.strings.action_display_show_continue_reading_button),
label = stringResource(MR.strings.action_display_show_continue_reading_button),
pref = screenModel.libraryPreferences.showContinueReadingButton(),
)
HeadingItem(MR.strings.tabs_header)
CheckboxItem(
label = localize(MR.strings.action_display_show_tabs),
label = stringResource(MR.strings.action_display_show_tabs),
pref = screenModel.libraryPreferences.categoryTabs(),
)
CheckboxItem(
label = localize(MR.strings.action_display_show_number_of_items),
label = stringResource(MR.strings.action_display_show_number_of_items),
pref = screenModel.libraryPreferences.categoryNumberOfItems(),
)
}

View File

@@ -40,7 +40,7 @@ import androidx.compose.ui.unit.sp
import eu.kanade.presentation.manga.components.MangaCover
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.BadgeGroup
import tachiyomi.presentation.core.i18n.localize
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.selectedBackground
object CommonMangaItemDefaults {
@@ -378,7 +378,7 @@ private fun ContinueReadingButton(
) {
Icon(
imageVector = Icons.Filled.PlayArrow,
contentDescription = localize(MR.strings.action_resume),
contentDescription = stringResource(MR.strings.action_resume),
modifier = Modifier.size(16.dp),
)
}

View File

@@ -6,7 +6,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.zIndex
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.localize
import tachiyomi.presentation.core.i18n.stringResource
@Composable
internal fun GlobalSearchItem(
@@ -19,7 +19,7 @@ internal fun GlobalSearchItem(
onClick = onClick,
) {
Text(
text = localize(MR.strings.action_global_search_query, searchQuery),
text = stringResource(MR.strings.action_global_search_query, searchQuery),
modifier = Modifier.zIndex(99f),
)
}

View File

@@ -22,7 +22,7 @@ import eu.kanade.presentation.components.SearchToolbar
import kotlinx.collections.immutable.persistentListOf
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.Pill
import tachiyomi.presentation.core.i18n.localize
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.theme.active
@Composable
@@ -98,21 +98,21 @@ private fun LibraryRegularToolbar(
AppBarActions(
persistentListOf(
AppBar.Action(
title = localize(MR.strings.action_filter),
title = stringResource(MR.strings.action_filter),
icon = Icons.Outlined.FilterList,
iconTint = filterTint,
onClick = onClickFilter,
),
AppBar.OverflowAction(
title = localize(MR.strings.action_update_library),
title = stringResource(MR.strings.action_update_library),
onClick = onClickGlobalUpdate,
),
AppBar.OverflowAction(
title = localize(MR.strings.action_update_category),
title = stringResource(MR.strings.action_update_category),
onClick = onClickRefresh,
),
AppBar.OverflowAction(
title = localize(MR.strings.action_open_random_manga),
title = stringResource(MR.strings.action_open_random_manga),
onClick = onClickOpenRandomManga,
),
),
@@ -135,12 +135,12 @@ private fun LibrarySelectionToolbar(
AppBarActions(
persistentListOf(
AppBar.Action(
title = localize(MR.strings.action_select_all),
title = stringResource(MR.strings.action_select_all),
icon = Icons.Outlined.SelectAll,
onClick = onClickSelectAll,
),
AppBar.Action(
title = localize(MR.strings.action_select_inverse),
title = stringResource(MR.strings.action_select_inverse),
icon = Icons.Outlined.FlipToBack,
onClick = onClickInvertSelection,
),