Migrate to multiplatform string resources (#10147)
* Migrate to multiplatform string resources * Move plurals translations into separate files * Fix lint check on generated files
This commit is contained in:
@@ -25,20 +25,20 @@ import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import eu.kanade.domain.manga.model.downloadedFilter
|
||||
import eu.kanade.domain.manga.model.forceDownloaded
|
||||
import eu.kanade.presentation.components.TabbedDialog
|
||||
import eu.kanade.presentation.components.TabbedDialogPaddings
|
||||
import eu.kanade.tachiyomi.R
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import tachiyomi.core.preference.TriState
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.LabeledCheckbox
|
||||
import tachiyomi.presentation.core.components.RadioItem
|
||||
import tachiyomi.presentation.core.components.SortItem
|
||||
import tachiyomi.presentation.core.components.TriStateItem
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.theme.active
|
||||
|
||||
@Composable
|
||||
@@ -66,20 +66,20 @@ fun ChapterSettingsDialog(
|
||||
TabbedDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
tabTitles = persistentListOf(
|
||||
stringResource(R.string.action_filter),
|
||||
stringResource(R.string.action_sort),
|
||||
stringResource(R.string.action_display),
|
||||
localize(MR.strings.action_filter),
|
||||
localize(MR.strings.action_sort),
|
||||
localize(MR.strings.action_display),
|
||||
),
|
||||
tabOverflowMenuContent = { closeMenu ->
|
||||
DropdownMenuItem(
|
||||
text = { Text(stringResource(R.string.set_chapter_settings_as_default)) },
|
||||
text = { Text(localize(MR.strings.set_chapter_settings_as_default)) },
|
||||
onClick = {
|
||||
showSetAsDefaultDialog = true
|
||||
closeMenu()
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text(stringResource(R.string.action_reset)) },
|
||||
text = { Text(localize(MR.strings.action_reset)) },
|
||||
onClick = {
|
||||
onResetToDefault()
|
||||
closeMenu()
|
||||
@@ -136,17 +136,17 @@ private fun ColumnScope.FilterPage(
|
||||
onScanlatorFilterClicked: (() -> Unit),
|
||||
) {
|
||||
TriStateItem(
|
||||
label = stringResource(R.string.label_downloaded),
|
||||
label = localize(MR.strings.label_downloaded),
|
||||
state = downloadFilter,
|
||||
onClick = onDownloadFilterChanged,
|
||||
)
|
||||
TriStateItem(
|
||||
label = stringResource(R.string.action_filter_unread),
|
||||
label = localize(MR.strings.action_filter_unread),
|
||||
state = unreadFilter,
|
||||
onClick = onUnreadFilterChanged,
|
||||
)
|
||||
TriStateItem(
|
||||
label = stringResource(R.string.action_filter_bookmarked),
|
||||
label = localize(MR.strings.action_filter_bookmarked),
|
||||
state = bookmarkedFilter,
|
||||
onClick = onBookmarkedFilterChanged,
|
||||
)
|
||||
@@ -179,7 +179,7 @@ fun ScanlatorFilterItem(
|
||||
},
|
||||
)
|
||||
Text(
|
||||
text = stringResource(R.string.scanlator),
|
||||
text = localize(MR.strings.scanlator),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
@@ -192,13 +192,13 @@ private fun ColumnScope.SortPage(
|
||||
onItemSelected: (Long) -> Unit,
|
||||
) {
|
||||
listOf(
|
||||
R.string.sort_by_source to Manga.CHAPTER_SORTING_SOURCE,
|
||||
R.string.sort_by_number to Manga.CHAPTER_SORTING_NUMBER,
|
||||
R.string.sort_by_upload_date to Manga.CHAPTER_SORTING_UPLOAD_DATE,
|
||||
R.string.action_sort_alpha to Manga.CHAPTER_SORTING_ALPHABET,
|
||||
MR.strings.sort_by_source to Manga.CHAPTER_SORTING_SOURCE,
|
||||
MR.strings.sort_by_number to Manga.CHAPTER_SORTING_NUMBER,
|
||||
MR.strings.sort_by_upload_date to Manga.CHAPTER_SORTING_UPLOAD_DATE,
|
||||
MR.strings.action_sort_alpha to Manga.CHAPTER_SORTING_ALPHABET,
|
||||
).map { (titleRes, mode) ->
|
||||
SortItem(
|
||||
label = stringResource(titleRes),
|
||||
label = localize(titleRes),
|
||||
sortDescending = sortDescending.takeIf { sortingMode == mode },
|
||||
onClick = { onItemSelected(mode) },
|
||||
)
|
||||
@@ -211,11 +211,11 @@ private fun ColumnScope.DisplayPage(
|
||||
onItemSelected: (Long) -> Unit,
|
||||
) {
|
||||
listOf(
|
||||
R.string.show_title to Manga.CHAPTER_DISPLAY_NAME,
|
||||
R.string.show_chapter_number to Manga.CHAPTER_DISPLAY_NUMBER,
|
||||
MR.strings.show_title to Manga.CHAPTER_DISPLAY_NAME,
|
||||
MR.strings.show_chapter_number to Manga.CHAPTER_DISPLAY_NUMBER,
|
||||
).map { (titleRes, mode) ->
|
||||
RadioItem(
|
||||
label = stringResource(titleRes),
|
||||
label = localize(titleRes),
|
||||
selected = displayMode == mode,
|
||||
onClick = { onItemSelected(mode) },
|
||||
)
|
||||
@@ -231,15 +231,15 @@ private fun SetAsDefaultDialog(
|
||||
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
title = { Text(text = stringResource(R.string.chapter_settings)) },
|
||||
title = { Text(text = localize(MR.strings.chapter_settings)) },
|
||||
text = {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||
) {
|
||||
Text(text = stringResource(R.string.confirm_set_chapter_settings))
|
||||
Text(text = localize(MR.strings.confirm_set_chapter_settings))
|
||||
|
||||
LabeledCheckbox(
|
||||
label = stringResource(R.string.also_set_chapter_settings_for_library),
|
||||
label = localize(MR.strings.also_set_chapter_settings_for_library),
|
||||
checked = optionalChecked,
|
||||
onCheckedChange = { optionalChecked = it },
|
||||
)
|
||||
@@ -247,7 +247,7 @@ private fun SetAsDefaultDialog(
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = stringResource(R.string.action_cancel))
|
||||
Text(text = localize(MR.strings.action_cancel))
|
||||
}
|
||||
},
|
||||
confirmButton = {
|
||||
@@ -257,7 +257,7 @@ private fun SetAsDefaultDialog(
|
||||
onDismissRequest()
|
||||
},
|
||||
) {
|
||||
Text(text = stringResource(R.string.action_ok))
|
||||
Text(text = localize(MR.strings.action_ok))
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
@@ -8,9 +8,9 @@ import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import eu.kanade.tachiyomi.R
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
|
||||
@Composable
|
||||
fun DuplicateMangaDialog(
|
||||
@@ -21,10 +21,10 @@ fun DuplicateMangaDialog(
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
title = {
|
||||
Text(text = stringResource(R.string.are_you_sure))
|
||||
Text(text = localize(MR.strings.are_you_sure))
|
||||
},
|
||||
text = {
|
||||
Text(text = stringResource(R.string.confirm_add_duplicate_manga))
|
||||
Text(text = localize(MR.strings.confirm_add_duplicate_manga))
|
||||
},
|
||||
confirmButton = {
|
||||
FlowRow(
|
||||
@@ -36,13 +36,13 @@ fun DuplicateMangaDialog(
|
||||
onOpenManga()
|
||||
},
|
||||
) {
|
||||
Text(text = stringResource(R.string.action_show_manga))
|
||||
Text(text = localize(MR.strings.action_show_manga))
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = stringResource(R.string.action_cancel))
|
||||
Text(text = localize(MR.strings.action_cancel))
|
||||
}
|
||||
TextButton(
|
||||
onClick = {
|
||||
@@ -50,7 +50,7 @@ fun DuplicateMangaDialog(
|
||||
onConfirm()
|
||||
},
|
||||
) {
|
||||
Text(text = stringResource(R.string.action_add))
|
||||
Text(text = localize(MR.strings.action_add))
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -44,7 +44,6 @@ import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.util.fastAll
|
||||
import androidx.compose.ui.util.fastAny
|
||||
import androidx.compose.ui.util.fastMap
|
||||
@@ -58,7 +57,6 @@ import eu.kanade.presentation.manga.components.MangaInfoBox
|
||||
import eu.kanade.presentation.manga.components.MangaToolbar
|
||||
import eu.kanade.presentation.manga.components.MissingChapterCountListItem
|
||||
import eu.kanade.presentation.util.formatChapterNumber
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.model.Download
|
||||
import eu.kanade.tachiyomi.source.getNameForMangaInfo
|
||||
import eu.kanade.tachiyomi.ui.manga.ChapterList
|
||||
@@ -70,11 +68,13 @@ import tachiyomi.domain.chapter.service.missingChaptersCount
|
||||
import tachiyomi.domain.library.service.LibraryPreferences
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.domain.source.model.StubSource
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.TwoPanelBox
|
||||
import tachiyomi.presentation.core.components.VerticalFastScroller
|
||||
import tachiyomi.presentation.core.components.material.ExtendedFloatingActionButton
|
||||
import tachiyomi.presentation.core.components.material.PullRefresh
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.util.isScrolledToEnd
|
||||
import tachiyomi.presentation.core.util.isScrollingUp
|
||||
import java.text.DateFormat
|
||||
@@ -349,7 +349,7 @@ private fun MangaScreenSmallImpl(
|
||||
val isReading = remember(state.chapters) {
|
||||
state.chapters.fastAny { it.chapter.read }
|
||||
}
|
||||
Text(text = stringResource(if (isReading) R.string.action_resume else R.string.action_start))
|
||||
Text(text = localize(if (isReading) MR.strings.action_resume else MR.strings.action_start))
|
||||
},
|
||||
icon = { Icon(imageVector = Icons.Filled.PlayArrow, contentDescription = null) },
|
||||
onClick = onContinueReading,
|
||||
@@ -608,7 +608,7 @@ fun MangaScreenLargeImpl(
|
||||
state.chapters.fastAny { it.chapter.read }
|
||||
}
|
||||
Text(
|
||||
text = stringResource(if (isReading) R.string.action_resume else R.string.action_start),
|
||||
text = localize(if (isReading) MR.strings.action_resume else MR.strings.action_start),
|
||||
)
|
||||
},
|
||||
icon = { Icon(imageVector = Icons.Filled.PlayArrow, contentDescription = null) },
|
||||
@@ -787,8 +787,8 @@ private fun LazyListScope.sharedChapterItems(
|
||||
is ChapterList.Item -> {
|
||||
MangaChapterListItem(
|
||||
title = if (manga.displayMode == Manga.CHAPTER_DISPLAY_NUMBER) {
|
||||
stringResource(
|
||||
R.string.display_mode_chapter,
|
||||
localize(
|
||||
MR.strings.display_mode_chapter,
|
||||
formatChapterNumber(item.chapter.chapterNumber),
|
||||
)
|
||||
} else {
|
||||
@@ -806,8 +806,8 @@ private fun LazyListScope.sharedChapterItems(
|
||||
readProgress = item.chapter.lastPageRead
|
||||
.takeIf { !item.chapter.read && it > 0L }
|
||||
?.let {
|
||||
stringResource(
|
||||
R.string.chapter_progress,
|
||||
localize(
|
||||
MR.strings.chapter_progress,
|
||||
it + 1,
|
||||
)
|
||||
},
|
||||
|
||||
+7
-6
@@ -29,13 +29,14 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.unit.dp
|
||||
import eu.kanade.presentation.components.DropdownMenu
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.model.Download
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.material.IconButtonTokens
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.util.secondaryItemAlpha
|
||||
|
||||
enum class ChapterDownloadAction {
|
||||
@@ -98,7 +99,7 @@ private fun NotDownloadedIndicator(
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.ic_download_chapter_24dp),
|
||||
contentDescription = stringResource(R.string.manga_download),
|
||||
contentDescription = localize(MR.strings.manga_download),
|
||||
modifier = Modifier.size(IndicatorSize),
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
@@ -156,14 +157,14 @@ private fun DownloadingIndicator(
|
||||
}
|
||||
DropdownMenu(expanded = isMenuExpanded, onDismissRequest = { isMenuExpanded = false }) {
|
||||
DropdownMenuItem(
|
||||
text = { Text(text = stringResource(R.string.action_start_downloading_now)) },
|
||||
text = { Text(text = localize(MR.strings.action_start_downloading_now)) },
|
||||
onClick = {
|
||||
onClick(ChapterDownloadAction.START_NOW)
|
||||
isMenuExpanded = false
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text(text = stringResource(R.string.action_cancel)) },
|
||||
text = { Text(text = localize(MR.strings.action_cancel)) },
|
||||
onClick = {
|
||||
onClick(ChapterDownloadAction.CANCEL)
|
||||
isMenuExpanded = false
|
||||
@@ -204,7 +205,7 @@ private fun DownloadedIndicator(
|
||||
)
|
||||
DropdownMenu(expanded = isMenuExpanded, onDismissRequest = { isMenuExpanded = false }) {
|
||||
DropdownMenuItem(
|
||||
text = { Text(text = stringResource(R.string.action_delete)) },
|
||||
text = { Text(text = localize(MR.strings.action_delete)) },
|
||||
onClick = {
|
||||
onClick(ChapterDownloadAction.DELETE)
|
||||
isMenuExpanded = false
|
||||
@@ -232,7 +233,7 @@ private fun ErrorIndicator(
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.ErrorOutline,
|
||||
contentDescription = stringResource(R.string.chapter_error),
|
||||
contentDescription = localize(MR.strings.chapter_error),
|
||||
modifier = Modifier.size(IndicatorSize),
|
||||
tint = MaterialTheme.colorScheme.error,
|
||||
)
|
||||
|
||||
@@ -9,12 +9,12 @@ import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.pluralStringResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import eu.kanade.tachiyomi.R
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.material.SecondaryItemAlpha
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.i18n.localizePlural
|
||||
|
||||
@Composable
|
||||
fun ChapterHeader(
|
||||
@@ -35,9 +35,9 @@ fun ChapterHeader(
|
||||
) {
|
||||
Text(
|
||||
text = if (chapterCount == null) {
|
||||
stringResource(R.string.chapters)
|
||||
localize(MR.strings.chapters)
|
||||
} else {
|
||||
pluralStringResource(id = R.plurals.manga_num_chapters, count = chapterCount, chapterCount)
|
||||
localizePlural(MR.plurals.manga_num_chapters, count = chapterCount, chapterCount)
|
||||
},
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
color = MaterialTheme.colorScheme.onBackground,
|
||||
@@ -54,7 +54,7 @@ private fun MissingChaptersWarning(count: Int) {
|
||||
}
|
||||
|
||||
Text(
|
||||
text = pluralStringResource(id = R.plurals.missing_chapters, count = count, count),
|
||||
text = localizePlural(MR.plurals.missing_chapters, count = count, count),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
|
||||
+14
-13
@@ -48,7 +48,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.res.vectorResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
@@ -59,6 +58,8 @@ import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.isActive
|
||||
import kotlinx.coroutines.launch
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
@Composable
|
||||
@@ -107,7 +108,7 @@ fun MangaBottomActionMenu(
|
||||
) {
|
||||
if (onBookmarkClicked != null) {
|
||||
Button(
|
||||
title = stringResource(R.string.action_bookmark),
|
||||
title = localize(MR.strings.action_bookmark),
|
||||
icon = Icons.Outlined.BookmarkAdd,
|
||||
toConfirm = confirm[0],
|
||||
onLongClick = { onLongClickItem(0) },
|
||||
@@ -116,7 +117,7 @@ fun MangaBottomActionMenu(
|
||||
}
|
||||
if (onRemoveBookmarkClicked != null) {
|
||||
Button(
|
||||
title = stringResource(R.string.action_remove_bookmark),
|
||||
title = localize(MR.strings.action_remove_bookmark),
|
||||
icon = Icons.Outlined.BookmarkRemove,
|
||||
toConfirm = confirm[1],
|
||||
onLongClick = { onLongClickItem(1) },
|
||||
@@ -125,7 +126,7 @@ fun MangaBottomActionMenu(
|
||||
}
|
||||
if (onMarkAsReadClicked != null) {
|
||||
Button(
|
||||
title = stringResource(R.string.action_mark_as_read),
|
||||
title = localize(MR.strings.action_mark_as_read),
|
||||
icon = Icons.Outlined.DoneAll,
|
||||
toConfirm = confirm[2],
|
||||
onLongClick = { onLongClickItem(2) },
|
||||
@@ -134,7 +135,7 @@ fun MangaBottomActionMenu(
|
||||
}
|
||||
if (onMarkAsUnreadClicked != null) {
|
||||
Button(
|
||||
title = stringResource(R.string.action_mark_as_unread),
|
||||
title = localize(MR.strings.action_mark_as_unread),
|
||||
icon = Icons.Outlined.RemoveDone,
|
||||
toConfirm = confirm[3],
|
||||
onLongClick = { onLongClickItem(3) },
|
||||
@@ -143,7 +144,7 @@ fun MangaBottomActionMenu(
|
||||
}
|
||||
if (onMarkPreviousAsReadClicked != null) {
|
||||
Button(
|
||||
title = stringResource(R.string.action_mark_previous_as_read),
|
||||
title = localize(MR.strings.action_mark_previous_as_read),
|
||||
icon = ImageVector.vectorResource(R.drawable.ic_done_prev_24dp),
|
||||
toConfirm = confirm[4],
|
||||
onLongClick = { onLongClickItem(4) },
|
||||
@@ -152,7 +153,7 @@ fun MangaBottomActionMenu(
|
||||
}
|
||||
if (onDownloadClicked != null) {
|
||||
Button(
|
||||
title = stringResource(R.string.action_download),
|
||||
title = localize(MR.strings.action_download),
|
||||
icon = Icons.Outlined.Download,
|
||||
toConfirm = confirm[5],
|
||||
onLongClick = { onLongClickItem(5) },
|
||||
@@ -161,7 +162,7 @@ fun MangaBottomActionMenu(
|
||||
}
|
||||
if (onDeleteClicked != null) {
|
||||
Button(
|
||||
title = stringResource(R.string.action_delete),
|
||||
title = localize(MR.strings.action_delete),
|
||||
icon = Icons.Outlined.Delete,
|
||||
toConfirm = confirm[6],
|
||||
onLongClick = { onLongClickItem(6) },
|
||||
@@ -258,21 +259,21 @@ fun LibraryBottomActionMenu(
|
||||
.padding(horizontal = 8.dp, vertical = 12.dp),
|
||||
) {
|
||||
Button(
|
||||
title = stringResource(R.string.action_move_category),
|
||||
title = localize(MR.strings.action_move_category),
|
||||
icon = Icons.AutoMirrored.Outlined.Label,
|
||||
toConfirm = confirm[0],
|
||||
onLongClick = { onLongClickItem(0) },
|
||||
onClick = onChangeCategoryClicked,
|
||||
)
|
||||
Button(
|
||||
title = stringResource(R.string.action_mark_as_read),
|
||||
title = localize(MR.strings.action_mark_as_read),
|
||||
icon = Icons.Outlined.DoneAll,
|
||||
toConfirm = confirm[1],
|
||||
onLongClick = { onLongClickItem(1) },
|
||||
onClick = onMarkAsReadClicked,
|
||||
)
|
||||
Button(
|
||||
title = stringResource(R.string.action_mark_as_unread),
|
||||
title = localize(MR.strings.action_mark_as_unread),
|
||||
icon = Icons.Outlined.RemoveDone,
|
||||
toConfirm = confirm[2],
|
||||
onLongClick = { onLongClickItem(2) },
|
||||
@@ -281,7 +282,7 @@ fun LibraryBottomActionMenu(
|
||||
if (onDownloadClicked != null) {
|
||||
var downloadExpanded by remember { mutableStateOf(false) }
|
||||
Button(
|
||||
title = stringResource(R.string.action_download),
|
||||
title = localize(MR.strings.action_download),
|
||||
icon = Icons.Outlined.Download,
|
||||
toConfirm = confirm[3],
|
||||
onLongClick = { onLongClickItem(3) },
|
||||
@@ -296,7 +297,7 @@ fun LibraryBottomActionMenu(
|
||||
}
|
||||
}
|
||||
Button(
|
||||
title = stringResource(R.string.action_delete),
|
||||
title = localize(MR.strings.action_delete),
|
||||
icon = Icons.Outlined.Delete,
|
||||
toConfirm = confirm[4],
|
||||
onLongClick = { onLongClickItem(4) },
|
||||
|
||||
@@ -42,23 +42,22 @@ import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.platform.LocalViewConfiguration
|
||||
import androidx.compose.ui.platform.ViewConfiguration
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.model.Download
|
||||
import me.saket.swipe.SwipeableActionsBox
|
||||
import me.saket.swipe.rememberSwipeableActionsState
|
||||
import tachiyomi.domain.library.service.LibraryPreferences
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.material.ReadItemAlpha
|
||||
import tachiyomi.presentation.core.components.material.SecondaryItemAlpha
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.util.selectedBackground
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
@Composable
|
||||
fun MangaChapterListItem(
|
||||
modifier: Modifier = Modifier,
|
||||
title: String,
|
||||
date: String?,
|
||||
readProgress: String?,
|
||||
@@ -75,6 +74,7 @@ fun MangaChapterListItem(
|
||||
onClick: () -> Unit,
|
||||
onDownloadClick: ((ChapterDownloadAction) -> Unit)?,
|
||||
onChapterSwipe: (LibraryPreferences.ChapterSwipeAction) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val haptic = LocalHapticFeedback.current
|
||||
val density = LocalDensity.current
|
||||
@@ -143,7 +143,7 @@ fun MangaChapterListItem(
|
||||
if (!read) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.Circle,
|
||||
contentDescription = stringResource(R.string.unread),
|
||||
contentDescription = localize(MR.strings.unread),
|
||||
modifier = Modifier
|
||||
.height(8.dp)
|
||||
.padding(end = 4.dp),
|
||||
@@ -153,7 +153,7 @@ fun MangaChapterListItem(
|
||||
if (bookmark) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.Bookmark,
|
||||
contentDescription = stringResource(R.string.action_filter_bookmarked),
|
||||
contentDescription = localize(MR.strings.action_filter_bookmarked),
|
||||
modifier = Modifier
|
||||
.sizeIn(maxHeight = with(LocalDensity.current) { textHeight.toDp() - 2.dp }),
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
|
||||
@@ -32,7 +32,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.DpOffset
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
@@ -47,11 +46,12 @@ import eu.kanade.presentation.components.AppBar
|
||||
import eu.kanade.presentation.components.AppBarActions
|
||||
import eu.kanade.presentation.components.DropdownMenu
|
||||
import eu.kanade.presentation.manga.EditCoverAction
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.ui.reader.viewer.ReaderPageImageView
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.util.clickableNoIndication
|
||||
|
||||
@Composable
|
||||
@@ -85,7 +85,7 @@ fun MangaCoverDialog(
|
||||
IconButton(onClick = onDismissRequest) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.Close,
|
||||
contentDescription = stringResource(R.string.action_close),
|
||||
contentDescription = localize(MR.strings.action_close),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -94,12 +94,12 @@ fun MangaCoverDialog(
|
||||
AppBarActions(
|
||||
actions = persistentListOf(
|
||||
AppBar.Action(
|
||||
title = stringResource(R.string.action_share),
|
||||
title = localize(MR.strings.action_share),
|
||||
icon = Icons.Outlined.Share,
|
||||
onClick = onShareClick,
|
||||
),
|
||||
AppBar.Action(
|
||||
title = stringResource(R.string.action_save),
|
||||
title = localize(MR.strings.action_save),
|
||||
icon = Icons.Outlined.Save,
|
||||
onClick = onSaveClick,
|
||||
),
|
||||
@@ -119,7 +119,7 @@ fun MangaCoverDialog(
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.Edit,
|
||||
contentDescription = stringResource(R.string.action_edit_cover),
|
||||
contentDescription = localize(MR.strings.action_edit_cover),
|
||||
)
|
||||
}
|
||||
DropdownMenu(
|
||||
@@ -128,14 +128,14 @@ fun MangaCoverDialog(
|
||||
offset = DpOffset(8.dp, 0.dp),
|
||||
) {
|
||||
DropdownMenuItem(
|
||||
text = { Text(text = stringResource(R.string.action_edit)) },
|
||||
text = { Text(text = localize(MR.strings.action_edit)) },
|
||||
onClick = {
|
||||
onEditClick(EditCoverAction.EDIT)
|
||||
expanded = false
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text(text = stringResource(R.string.action_delete)) },
|
||||
text = { Text(text = localize(MR.strings.action_delete)) },
|
||||
onClick = {
|
||||
onEditClick(EditCoverAction.DELETE)
|
||||
expanded = false
|
||||
|
||||
@@ -12,13 +12,13 @@ import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.DpSize
|
||||
import androidx.compose.ui.unit.dp
|
||||
import eu.kanade.tachiyomi.R
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import tachiyomi.domain.manga.interactor.FetchInterval
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.WheelTextPicker
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
|
||||
@Composable
|
||||
fun DeleteChaptersDialog(
|
||||
@@ -29,7 +29,7 @@ fun DeleteChaptersDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
dismissButton = {
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = stringResource(R.string.action_cancel))
|
||||
Text(text = localize(MR.strings.action_cancel))
|
||||
}
|
||||
},
|
||||
confirmButton = {
|
||||
@@ -39,14 +39,14 @@ fun DeleteChaptersDialog(
|
||||
onConfirm()
|
||||
},
|
||||
) {
|
||||
Text(text = stringResource(R.string.action_ok))
|
||||
Text(text = localize(MR.strings.action_ok))
|
||||
}
|
||||
},
|
||||
title = {
|
||||
Text(text = stringResource(R.string.are_you_sure))
|
||||
Text(text = localize(MR.strings.are_you_sure))
|
||||
},
|
||||
text = {
|
||||
Text(text = stringResource(R.string.confirm_delete_chapters))
|
||||
Text(text = localize(MR.strings.confirm_delete_chapters))
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -61,7 +61,7 @@ fun SetIntervalDialog(
|
||||
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
title = { Text(text = stringResource(R.string.manga_modify_calculated_interval_title)) },
|
||||
title = { Text(text = localize(MR.strings.manga_modify_calculated_interval_title)) },
|
||||
text = {
|
||||
BoxWithConstraints(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
@@ -71,7 +71,7 @@ fun SetIntervalDialog(
|
||||
val items = (0..FetchInterval.MAX_INTERVAL)
|
||||
.map {
|
||||
if (it == 0) {
|
||||
stringResource(R.string.label_default)
|
||||
localize(MR.strings.label_default)
|
||||
} else {
|
||||
it.toString()
|
||||
}
|
||||
@@ -87,7 +87,7 @@ fun SetIntervalDialog(
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = stringResource(R.string.action_cancel))
|
||||
Text(text = localize(MR.strings.action_cancel))
|
||||
}
|
||||
},
|
||||
confirmButton = {
|
||||
@@ -95,7 +95,7 @@ fun SetIntervalDialog(
|
||||
onValueChanged(selectedInterval)
|
||||
onDismissRequest()
|
||||
}) {
|
||||
Text(text = stringResource(R.string.action_ok))
|
||||
Text(text = localize(MR.strings.action_ok))
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
@@ -66,8 +66,6 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.layout.Layout
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.pluralStringResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.Constraints
|
||||
@@ -80,8 +78,11 @@ import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.material.TextButton
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.i18n.localizePlural
|
||||
import tachiyomi.presentation.core.util.clickableNoIndication
|
||||
import tachiyomi.presentation.core.util.secondaryItemAlpha
|
||||
import kotlin.math.absoluteValue
|
||||
@@ -178,9 +179,9 @@ fun MangaActionRow(
|
||||
Row(modifier = modifier.padding(start = 16.dp, top = 8.dp, end = 16.dp)) {
|
||||
MangaActionButton(
|
||||
title = if (favorite) {
|
||||
stringResource(R.string.in_library)
|
||||
localize(MR.strings.in_library)
|
||||
} else {
|
||||
stringResource(R.string.add_to_library)
|
||||
localize(MR.strings.add_to_library)
|
||||
},
|
||||
icon = if (favorite) Icons.Filled.Favorite else Icons.Outlined.FavoriteBorder,
|
||||
color = if (favorite) MaterialTheme.colorScheme.primary else defaultActionButtonColor,
|
||||
@@ -189,8 +190,8 @@ fun MangaActionRow(
|
||||
)
|
||||
if (onEditIntervalClicked != null && fetchInterval != null) {
|
||||
MangaActionButton(
|
||||
title = pluralStringResource(
|
||||
id = R.plurals.day,
|
||||
title = localizePlural(
|
||||
MR.plurals.day,
|
||||
count = fetchInterval.absoluteValue,
|
||||
fetchInterval.absoluteValue,
|
||||
),
|
||||
@@ -202,9 +203,9 @@ fun MangaActionRow(
|
||||
if (onTrackingClicked != null) {
|
||||
MangaActionButton(
|
||||
title = if (trackingCount == 0) {
|
||||
stringResource(R.string.manga_tracking_tab)
|
||||
localize(MR.strings.manga_tracking_tab)
|
||||
} else {
|
||||
pluralStringResource(id = R.plurals.num_trackers, count = trackingCount, trackingCount)
|
||||
localizePlural(MR.plurals.num_trackers, count = trackingCount, trackingCount)
|
||||
},
|
||||
icon = if (trackingCount == 0) Icons.Outlined.Sync else Icons.Outlined.Done,
|
||||
color = if (trackingCount == 0) defaultActionButtonColor else MaterialTheme.colorScheme.primary,
|
||||
@@ -213,7 +214,7 @@ fun MangaActionRow(
|
||||
}
|
||||
if (onWebViewClicked != null) {
|
||||
MangaActionButton(
|
||||
title = stringResource(R.string.action_web_view),
|
||||
title = localize(MR.strings.action_web_view),
|
||||
icon = Icons.Outlined.Public,
|
||||
color = defaultActionButtonColor,
|
||||
onClick = onWebViewClicked,
|
||||
@@ -237,7 +238,7 @@ fun ExpandableMangaDescription(
|
||||
mutableStateOf(defaultExpandState)
|
||||
}
|
||||
val desc =
|
||||
description.takeIf { !it.isNullOrBlank() } ?: stringResource(R.string.description_placeholder)
|
||||
description.takeIf { !it.isNullOrBlank() } ?: localize(MR.strings.description_placeholder)
|
||||
val trimmedDescription = remember(desc) {
|
||||
desc
|
||||
.replace(whitespaceLineRegex, "\n")
|
||||
@@ -267,14 +268,14 @@ fun ExpandableMangaDescription(
|
||||
onDismissRequest = { showMenu = false },
|
||||
) {
|
||||
DropdownMenuItem(
|
||||
text = { Text(text = stringResource(R.string.action_search)) },
|
||||
text = { Text(text = localize(MR.strings.action_search)) },
|
||||
onClick = {
|
||||
onTagSearch(tagSelected)
|
||||
showMenu = false
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text(text = stringResource(R.string.action_copy_to_clipboard)) },
|
||||
text = { Text(text = localize(MR.strings.action_copy_to_clipboard)) },
|
||||
onClick = {
|
||||
onCopyTagToClipboard(tagSelected)
|
||||
showMenu = false
|
||||
@@ -341,7 +342,7 @@ private fun MangaAndSourceTitlesLarge(
|
||||
MangaCover.Book(
|
||||
modifier = Modifier.fillMaxWidth(0.65f),
|
||||
data = coverDataProvider(),
|
||||
contentDescription = stringResource(R.string.manga_cover),
|
||||
contentDescription = localize(MR.strings.manga_cover),
|
||||
onClick = onCoverClick,
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
@@ -383,7 +384,7 @@ private fun MangaAndSourceTitlesSmall(
|
||||
.sizeIn(maxWidth = 100.dp)
|
||||
.align(Alignment.Top),
|
||||
data = coverDataProvider(),
|
||||
contentDescription = stringResource(R.string.manga_cover),
|
||||
contentDescription = localize(MR.strings.manga_cover),
|
||||
onClick = onCoverClick,
|
||||
)
|
||||
Column(
|
||||
@@ -415,7 +416,7 @@ private fun MangaContentInfo(
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
Text(
|
||||
text = title.ifBlank { stringResource(R.string.unknown_title) },
|
||||
text = title.ifBlank { localize(MR.strings.unknown_title) },
|
||||
style = MaterialTheme.typography.titleLarge,
|
||||
modifier = Modifier.clickableNoIndication(
|
||||
onLongClick = {
|
||||
@@ -445,7 +446,7 @@ private fun MangaContentInfo(
|
||||
)
|
||||
Text(
|
||||
text = author?.takeIf { it.isNotBlank() }
|
||||
?: stringResource(R.string.unknown_author),
|
||||
?: localize(MR.strings.unknown_author),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
modifier = Modifier
|
||||
.clickableNoIndication(
|
||||
@@ -511,13 +512,13 @@ private fun MangaContentInfo(
|
||||
ProvideTextStyle(MaterialTheme.typography.bodyMedium) {
|
||||
Text(
|
||||
text = when (status) {
|
||||
SManga.ONGOING.toLong() -> stringResource(R.string.ongoing)
|
||||
SManga.COMPLETED.toLong() -> stringResource(R.string.completed)
|
||||
SManga.LICENSED.toLong() -> stringResource(R.string.licensed)
|
||||
SManga.PUBLISHING_FINISHED.toLong() -> stringResource(R.string.publishing_finished)
|
||||
SManga.CANCELLED.toLong() -> stringResource(R.string.cancelled)
|
||||
SManga.ON_HIATUS.toLong() -> stringResource(R.string.on_hiatus)
|
||||
else -> stringResource(R.string.unknown)
|
||||
SManga.ONGOING.toLong() -> localize(MR.strings.ongoing)
|
||||
SManga.COMPLETED.toLong() -> localize(MR.strings.completed)
|
||||
SManga.LICENSED.toLong() -> localize(MR.strings.licensed)
|
||||
SManga.PUBLISHING_FINISHED.toLong() -> localize(MR.strings.publishing_finished)
|
||||
SManga.CANCELLED.toLong() -> localize(MR.strings.cancelled)
|
||||
SManga.ON_HIATUS.toLong() -> localize(MR.strings.on_hiatus)
|
||||
else -> localize(MR.strings.unknown)
|
||||
},
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 1,
|
||||
@@ -591,8 +592,8 @@ private fun MangaSummary(
|
||||
val image = AnimatedImageVector.animatedVectorResource(R.drawable.anim_caret_down)
|
||||
Icon(
|
||||
painter = rememberAnimatedVectorPainter(image, !expanded),
|
||||
contentDescription = stringResource(
|
||||
if (expanded) R.string.manga_info_collapse else R.string.manga_info_expand,
|
||||
contentDescription = localize(
|
||||
if (expanded) MR.strings.manga_info_collapse else MR.strings.manga_info_expand,
|
||||
),
|
||||
tint = MaterialTheme.colorScheme.onBackground,
|
||||
modifier = Modifier.background(Brush.radialGradient(colors = colors.asReversed())),
|
||||
|
||||
@@ -21,7 +21,6 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import eu.kanade.presentation.components.AppBar
|
||||
@@ -29,8 +28,9 @@ import eu.kanade.presentation.components.AppBarActions
|
||||
import eu.kanade.presentation.components.DownloadDropdownMenu
|
||||
import eu.kanade.presentation.components.UpIcon
|
||||
import eu.kanade.presentation.manga.DownloadAction
|
||||
import eu.kanade.tachiyomi.R
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.theme.active
|
||||
|
||||
@Composable
|
||||
@@ -75,12 +75,12 @@ fun MangaToolbar(
|
||||
AppBarActions(
|
||||
persistentListOf(
|
||||
AppBar.Action(
|
||||
title = stringResource(R.string.action_select_all),
|
||||
title = localize(MR.strings.action_select_all),
|
||||
icon = Icons.Outlined.SelectAll,
|
||||
onClick = onSelectAll,
|
||||
),
|
||||
AppBar.Action(
|
||||
title = stringResource(R.string.action_select_inverse),
|
||||
title = localize(MR.strings.action_select_inverse),
|
||||
icon = Icons.Outlined.FlipToBack,
|
||||
onClick = onInvertSelection,
|
||||
),
|
||||
@@ -104,7 +104,7 @@ fun MangaToolbar(
|
||||
if (onClickDownload != null) {
|
||||
add(
|
||||
AppBar.Action(
|
||||
title = stringResource(R.string.manga_download),
|
||||
title = localize(MR.strings.manga_download),
|
||||
icon = Icons.Outlined.Download,
|
||||
onClick = { downloadExpanded = !downloadExpanded },
|
||||
),
|
||||
@@ -112,7 +112,7 @@ fun MangaToolbar(
|
||||
}
|
||||
add(
|
||||
AppBar.Action(
|
||||
title = stringResource(R.string.action_filter),
|
||||
title = localize(MR.strings.action_filter),
|
||||
icon = Icons.Outlined.FilterList,
|
||||
iconTint = filterTint,
|
||||
onClick = onClickFilter,
|
||||
@@ -120,14 +120,14 @@ fun MangaToolbar(
|
||||
)
|
||||
add(
|
||||
AppBar.OverflowAction(
|
||||
title = stringResource(R.string.action_webview_refresh),
|
||||
title = localize(MR.strings.action_webview_refresh),
|
||||
onClick = onClickRefresh,
|
||||
),
|
||||
)
|
||||
if (onClickEditCategory != null) {
|
||||
add(
|
||||
AppBar.OverflowAction(
|
||||
title = stringResource(R.string.action_edit_categories),
|
||||
title = localize(MR.strings.action_edit_categories),
|
||||
onClick = onClickEditCategory,
|
||||
),
|
||||
)
|
||||
@@ -135,7 +135,7 @@ fun MangaToolbar(
|
||||
if (onClickMigrate != null) {
|
||||
add(
|
||||
AppBar.OverflowAction(
|
||||
title = stringResource(R.string.action_migrate),
|
||||
title = localize(MR.strings.action_migrate),
|
||||
onClick = onClickMigrate,
|
||||
),
|
||||
)
|
||||
@@ -143,7 +143,7 @@ fun MangaToolbar(
|
||||
if (onClickShare != null) {
|
||||
add(
|
||||
AppBar.OverflowAction(
|
||||
title = stringResource(R.string.action_share),
|
||||
title = localize(MR.strings.action_share),
|
||||
onClick = onClickShare,
|
||||
),
|
||||
)
|
||||
|
||||
+3
-3
@@ -10,11 +10,11 @@ import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.pluralStringResource
|
||||
import androidx.compose.ui.tooling.preview.PreviewLightDark
|
||||
import eu.kanade.presentation.theme.TachiyomiTheme
|
||||
import eu.kanade.tachiyomi.R
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
import tachiyomi.presentation.core.i18n.localizePlural
|
||||
import tachiyomi.presentation.core.util.secondaryItemAlpha
|
||||
|
||||
@Composable
|
||||
@@ -34,7 +34,7 @@ fun MissingChapterCountListItem(
|
||||
) {
|
||||
HorizontalDivider(modifier = Modifier.weight(1f))
|
||||
Text(
|
||||
text = pluralStringResource(id = R.plurals.missing_chapters, count = count, count),
|
||||
text = localizePlural(MR.plurals.missing_chapters, count = count, count),
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
)
|
||||
HorizontalDivider(modifier = Modifier.weight(1f))
|
||||
|
||||
@@ -27,12 +27,12 @@ import androidx.compose.runtime.toMutableStateList
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import eu.kanade.tachiyomi.R
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.material.TextButton
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.core.util.isScrolledToEnd
|
||||
import tachiyomi.presentation.core.util.isScrolledToStart
|
||||
|
||||
@@ -49,10 +49,10 @@ fun ScanlatorFilterDialog(
|
||||
val mutableExcludedScanlators = remember(excludedScanlators) { excludedScanlators.toMutableStateList() }
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
title = { Text(text = stringResource(R.string.exclude_scanlators)) },
|
||||
title = { Text(text = localize(MR.strings.exclude_scanlators)) },
|
||||
text = textFunc@{
|
||||
if (sortedAvailableScanlators.isEmpty()) {
|
||||
Text(text = stringResource(R.string.no_scanlators_found))
|
||||
Text(text = localize(MR.strings.no_scanlators_found))
|
||||
return@textFunc
|
||||
}
|
||||
Box {
|
||||
@@ -108,16 +108,16 @@ fun ScanlatorFilterDialog(
|
||||
confirmButton = {
|
||||
if (sortedAvailableScanlators.isEmpty()) {
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = stringResource(R.string.action_cancel))
|
||||
Text(text = localize(MR.strings.action_cancel))
|
||||
}
|
||||
} else {
|
||||
FlowRow {
|
||||
TextButton(onClick = mutableExcludedScanlators::clear) {
|
||||
Text(text = stringResource(R.string.action_reset))
|
||||
Text(text = localize(MR.strings.action_reset))
|
||||
}
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = stringResource(R.string.action_cancel))
|
||||
Text(text = localize(MR.strings.action_cancel))
|
||||
}
|
||||
TextButton(
|
||||
onClick = {
|
||||
@@ -125,7 +125,7 @@ fun ScanlatorFilterDialog(
|
||||
onDismissRequest()
|
||||
},
|
||||
) {
|
||||
Text(text = stringResource(R.string.action_ok))
|
||||
Text(text = localize(MR.strings.action_ok))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user