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
@@ -19,7 +19,7 @@ import eu.kanade.tachiyomi.util.system.toShareIntent
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import logcat.LogPriority
import tachiyomi.core.i18n.localize
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.util.lang.launchIO
import tachiyomi.core.util.lang.withIOContext
import tachiyomi.core.util.lang.withUIContext
@@ -52,13 +52,13 @@ class MangaCoverScreenModel(
try {
saveCoverInternal(context, temp = false)
snackbarHostState.showSnackbar(
context.localize(MR.strings.cover_saved),
context.stringResource(MR.strings.cover_saved),
withDismissAction = true,
)
} catch (e: Throwable) {
logcat(LogPriority.ERROR, e)
snackbarHostState.showSnackbar(
context.localize(MR.strings.error_saving_cover),
context.stringResource(MR.strings.error_saving_cover),
withDismissAction = true,
)
}
@@ -75,7 +75,7 @@ class MangaCoverScreenModel(
} catch (e: Throwable) {
logcat(LogPriority.ERROR, e)
snackbarHostState.showSnackbar(
context.localize(MR.strings.error_sharing_cover),
context.stringResource(MR.strings.error_sharing_cover),
withDismissAction = true,
)
}
@@ -146,7 +146,7 @@ class MangaCoverScreenModel(
private fun notifyCoverUpdated(context: Context) {
screenModelScope.launch {
snackbarHostState.showSnackbar(
context.localize(MR.strings.cover_updated),
context.stringResource(MR.strings.cover_updated),
withDismissAction = true,
)
}
@@ -155,7 +155,7 @@ class MangaCoverScreenModel(
private fun notifyFailedCoverUpdate(context: Context, e: Throwable) {
screenModelScope.launch {
snackbarHostState.showSnackbar(
context.localize(MR.strings.notification_cover_update_failed),
context.stringResource(MR.strings.notification_cover_update_failed),
withDismissAction = true,
)
logcat(LogPriority.ERROR, e)
@@ -53,7 +53,7 @@ import eu.kanade.tachiyomi.util.system.toShareIntent
import eu.kanade.tachiyomi.util.system.toast
import kotlinx.coroutines.launch
import logcat.LogPriority
import tachiyomi.core.i18n.localize
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.util.lang.withIOContext
import tachiyomi.core.util.system.logcat
import tachiyomi.domain.chapter.model.Chapter
@@ -292,7 +292,7 @@ class MangaScreen(
context.startActivity(
Intent.createChooser(
intent,
context.localize(MR.strings.action_share),
context.stringResource(MR.strings.action_share),
),
)
}
@@ -49,7 +49,7 @@ import kotlinx.coroutines.flow.update
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import logcat.LogPriority
import tachiyomi.core.i18n.localize
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.preference.CheckboxState
import tachiyomi.core.preference.TriState
import tachiyomi.core.preference.mapAsCheckboxState
@@ -282,8 +282,8 @@ class MangaScreenModel(
screenModelScope.launch {
if (!hasDownloads()) return@launch
val result = snackbarHostState.showSnackbar(
message = context.localize(MR.strings.delete_downloads_for_manga),
actionLabel = context.localize(MR.strings.action_delete),
message = context.stringResource(MR.strings.delete_downloads_for_manga),
actionLabel = context.stringResource(MR.strings.action_delete),
withDismissAction = true,
)
if (result == SnackbarResult.ActionPerformed) {
@@ -551,7 +551,7 @@ class MangaScreenModel(
}
} catch (e: Throwable) {
val message = if (e is NoChaptersException) {
context.localize(MR.strings.no_chapters_error)
context.stringResource(MR.strings.no_chapters_error)
} else {
logcat(LogPriority.ERROR, e)
with(context) { e.formattedMessage }
@@ -648,8 +648,8 @@ class MangaScreenModel(
}
screenModelScope.launch {
val result = snackbarHostState.showSnackbar(
message = context.localize(MR.strings.snack_add_to_library),
actionLabel = context.localize(MR.strings.action_add),
message = context.stringResource(MR.strings.snack_add_to_library),
actionLabel = context.stringResource(MR.strings.action_add),
withDismissAction = true,
)
if (result == SnackbarResult.ActionPerformed && !isFavorited) {
@@ -870,7 +870,7 @@ class MangaScreenModel(
if (applyToExisting) {
setMangaDefaultChapterFlags.awaitAll()
}
snackbarHostState.showSnackbar(message = context.localize(MR.strings.chapter_settings_updated))
snackbarHostState.showSnackbar(message = context.stringResource(MR.strings.chapter_settings_updated))
}
}
@@ -65,7 +65,7 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import logcat.LogPriority
import tachiyomi.core.i18n.localize
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.util.lang.launchNonCancellable
import tachiyomi.core.util.lang.withIOContext
import tachiyomi.core.util.lang.withUIContext
@@ -79,7 +79,7 @@ import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.LabeledCheckbox
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 uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.time.Instant
@@ -229,7 +229,7 @@ data class TrackInfoDialogHomeScreen(
}
withUIContext {
context.toast(
context.localize(
context.stringResource(
MR.strings.track_error,
track!!.name,
e.message ?: "",
@@ -502,9 +502,9 @@ private data class TrackDateSelectorScreen(
}
TrackDateSelector(
title = if (start) {
localize(MR.strings.track_started_reading_date)
stringResource(MR.strings.track_started_reading_date)
} else {
localize(MR.strings.track_finished_reading_date)
stringResource(MR.strings.track_finished_reading_date)
},
initialSelectedDateMillis = screenModel.initialSelection,
selectableDates = selectableDates,
@@ -577,7 +577,7 @@ private data class TrackDateRemoverScreen(
},
title = {
Text(
text = localize(MR.strings.track_remove_date_conf_title),
text = stringResource(MR.strings.track_remove_date_conf_title),
textAlign = TextAlign.Center,
)
},
@@ -585,9 +585,9 @@ private data class TrackDateRemoverScreen(
val serviceName = screenModel.getServiceName()
Text(
text = if (start) {
localize(MR.strings.track_remove_start_date_conf_text, serviceName)
stringResource(MR.strings.track_remove_start_date_conf_text, serviceName)
} else {
localize(MR.strings.track_remove_finish_date_conf_text, serviceName)
stringResource(MR.strings.track_remove_finish_date_conf_text, serviceName)
},
)
},
@@ -597,7 +597,7 @@ private data class TrackDateRemoverScreen(
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small, Alignment.End),
) {
TextButton(onClick = navigator::pop) {
Text(text = localize(MR.strings.action_cancel))
Text(text = stringResource(MR.strings.action_cancel))
}
FilledTonalButton(
onClick = {
@@ -609,7 +609,7 @@ private data class TrackDateRemoverScreen(
contentColor = MaterialTheme.colorScheme.onErrorContainer,
),
) {
Text(text = localize(MR.strings.action_remove))
Text(text = stringResource(MR.strings.action_remove))
}
}
},
@@ -753,7 +753,7 @@ private data class TrackerRemoveScreen(
},
title = {
Text(
text = localize(MR.strings.track_delete_title, serviceName),
text = stringResource(MR.strings.track_delete_title, serviceName),
textAlign = TextAlign.Center,
)
},
@@ -762,12 +762,12 @@ private data class TrackerRemoveScreen(
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
Text(
text = localize(MR.strings.track_delete_text, serviceName),
text = stringResource(MR.strings.track_delete_text, serviceName),
)
if (screenModel.isDeletable()) {
LabeledCheckbox(
label = localize(MR.strings.track_delete_remote_text, serviceName),
label = stringResource(MR.strings.track_delete_remote_text, serviceName),
checked = removeRemoteTrack,
onCheckedChange = { removeRemoteTrack = it },
)
@@ -783,7 +783,7 @@ private data class TrackerRemoveScreen(
),
) {
TextButton(onClick = navigator::pop) {
Text(text = localize(MR.strings.action_cancel))
Text(text = stringResource(MR.strings.action_cancel))
}
FilledTonalButton(
onClick = {
@@ -796,7 +796,7 @@ private data class TrackerRemoveScreen(
contentColor = MaterialTheme.colorScheme.onErrorContainer,
),
) {
Text(text = localize(MR.strings.action_ok))
Text(text = stringResource(MR.strings.action_ok))
}
}
},