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
@@ -16,7 +16,7 @@ import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.CheckboxItem
import tachiyomi.presentation.core.components.SettingsChipRow
import tachiyomi.presentation.core.components.SliderItem
import tachiyomi.presentation.core.i18n.localize
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState
@Composable
@@ -38,11 +38,11 @@ internal fun ColumnScope.ColorFilterPage(screenModel: ReaderSettingsScreenModel)
),
)
}
}.map { localize(it) }
}.map { stringResource(it) }
val customBrightness by screenModel.preferences.customBrightness().collectAsState()
CheckboxItem(
label = localize(MR.strings.pref_custom_brightness),
label = stringResource(MR.strings.pref_custom_brightness),
pref = screenModel.preferences.customBrightness(),
)
@@ -55,7 +55,7 @@ internal fun ColumnScope.ColorFilterPage(screenModel: ReaderSettingsScreenModel)
if (customBrightness) {
val customBrightnessValue by screenModel.preferences.customBrightnessValue().collectAsState()
SliderItem(
label = localize(MR.strings.pref_custom_brightness),
label = stringResource(MR.strings.pref_custom_brightness),
min = -75,
max = 100,
value = customBrightnessValue,
@@ -66,13 +66,13 @@ internal fun ColumnScope.ColorFilterPage(screenModel: ReaderSettingsScreenModel)
val colorFilter by screenModel.preferences.colorFilter().collectAsState()
CheckboxItem(
label = localize(MR.strings.pref_custom_color_filter),
label = stringResource(MR.strings.pref_custom_color_filter),
pref = screenModel.preferences.colorFilter(),
)
if (colorFilter) {
val colorFilterValue by screenModel.preferences.colorFilterValue().collectAsState()
SliderItem(
label = localize(MR.strings.color_filter_r_value),
label = stringResource(MR.strings.color_filter_r_value),
max = 255,
value = colorFilterValue.red,
valueText = colorFilterValue.red.toString(),
@@ -83,7 +83,7 @@ internal fun ColumnScope.ColorFilterPage(screenModel: ReaderSettingsScreenModel)
},
)
SliderItem(
label = localize(MR.strings.color_filter_g_value),
label = stringResource(MR.strings.color_filter_g_value),
max = 255,
value = colorFilterValue.green,
valueText = colorFilterValue.green.toString(),
@@ -94,7 +94,7 @@ internal fun ColumnScope.ColorFilterPage(screenModel: ReaderSettingsScreenModel)
},
)
SliderItem(
label = localize(MR.strings.color_filter_b_value),
label = stringResource(MR.strings.color_filter_b_value),
max = 255,
value = colorFilterValue.blue,
valueText = colorFilterValue.blue.toString(),
@@ -105,7 +105,7 @@ internal fun ColumnScope.ColorFilterPage(screenModel: ReaderSettingsScreenModel)
},
)
SliderItem(
label = localize(MR.strings.color_filter_a_value),
label = stringResource(MR.strings.color_filter_a_value),
max = 255,
value = colorFilterValue.alpha,
valueText = colorFilterValue.alpha.toString(),
@@ -129,11 +129,11 @@ internal fun ColumnScope.ColorFilterPage(screenModel: ReaderSettingsScreenModel)
}
CheckboxItem(
label = localize(MR.strings.pref_grayscale),
label = stringResource(MR.strings.pref_grayscale),
pref = screenModel.preferences.grayscale(),
)
CheckboxItem(
label = localize(MR.strings.pref_inverted_colors),
label = stringResource(MR.strings.pref_inverted_colors),
pref = screenModel.preferences.invertedColors(),
)
}
@@ -9,7 +9,7 @@ import eu.kanade.tachiyomi.ui.reader.setting.ReaderSettingsScreenModel
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.CheckboxItem
import tachiyomi.presentation.core.components.SettingsChipRow
import tachiyomi.presentation.core.i18n.localize
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState
private val themes = listOf(
@@ -27,50 +27,50 @@ internal fun ColumnScope.GeneralPage(screenModel: ReaderSettingsScreenModel) {
FilterChip(
selected = readerTheme == value,
onClick = { screenModel.preferences.readerTheme().set(value) },
label = { Text(localize(labelRes)) },
label = { Text(stringResource(labelRes)) },
)
}
}
CheckboxItem(
label = localize(MR.strings.pref_show_page_number),
label = stringResource(MR.strings.pref_show_page_number),
pref = screenModel.preferences.showPageNumber(),
)
CheckboxItem(
label = localize(MR.strings.pref_fullscreen),
label = stringResource(MR.strings.pref_fullscreen),
pref = screenModel.preferences.fullscreen(),
)
if (screenModel.hasDisplayCutout) {
CheckboxItem(
label = localize(MR.strings.pref_cutout_short),
label = stringResource(MR.strings.pref_cutout_short),
pref = screenModel.preferences.cutoutShort(),
)
}
CheckboxItem(
label = localize(MR.strings.pref_keep_screen_on),
label = stringResource(MR.strings.pref_keep_screen_on),
pref = screenModel.preferences.keepScreenOn(),
)
CheckboxItem(
label = localize(MR.strings.pref_read_with_long_tap),
label = stringResource(MR.strings.pref_read_with_long_tap),
pref = screenModel.preferences.readWithLongTap(),
)
CheckboxItem(
label = localize(MR.strings.pref_always_show_chapter_transition),
label = stringResource(MR.strings.pref_always_show_chapter_transition),
pref = screenModel.preferences.alwaysShowChapterTransition(),
)
CheckboxItem(
label = localize(MR.strings.pref_page_transitions),
label = stringResource(MR.strings.pref_page_transitions),
pref = screenModel.preferences.pageTransitions(),
)
CheckboxItem(
label = localize(MR.strings.pref_flash_page),
label = stringResource(MR.strings.pref_flash_page),
pref = screenModel.preferences.flashOnPageChange(),
)
}
@@ -17,7 +17,7 @@ import eu.kanade.presentation.components.TabbedDialogPaddings
import eu.kanade.tachiyomi.ui.reader.setting.ReaderSettingsScreenModel
import kotlinx.collections.immutable.persistentListOf
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.localize
import tachiyomi.presentation.core.i18n.stringResource
@Composable
fun ReaderSettingsDialog(
@@ -27,9 +27,9 @@ fun ReaderSettingsDialog(
screenModel: ReaderSettingsScreenModel,
) {
val tabTitles = persistentListOf(
localize(MR.strings.pref_category_reading_mode),
localize(MR.strings.pref_category_general),
localize(MR.strings.custom_filter),
stringResource(MR.strings.pref_category_reading_mode),
stringResource(MR.strings.pref_category_general),
stringResource(MR.strings.custom_filter),
)
val pagerState = rememberPagerState { tabTitles.size }
@@ -19,7 +19,7 @@ import tachiyomi.presentation.core.components.CheckboxItem
import tachiyomi.presentation.core.components.HeadingItem
import tachiyomi.presentation.core.components.SettingsChipRow
import tachiyomi.presentation.core.components.SliderItem
import tachiyomi.presentation.core.i18n.localize
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState
import java.text.NumberFormat
@@ -34,7 +34,7 @@ internal fun ColumnScope.ReadingModePage(screenModel: ReaderSettingsScreenModel)
FilterChip(
selected = it == readingMode,
onClick = { screenModel.onChangeReadingMode(it) },
label = { Text(localize(it.stringRes)) },
label = { Text(stringResource(it.stringRes)) },
)
}
}
@@ -45,7 +45,7 @@ internal fun ColumnScope.ReadingModePage(screenModel: ReaderSettingsScreenModel)
FilterChip(
selected = it == orientation,
onClick = { screenModel.onChangeOrientation(it) },
label = { Text(localize(it.stringRes)) },
label = { Text(stringResource(it.stringRes)) },
)
}
}
@@ -77,7 +77,7 @@ private fun ColumnScope.PagerViewerSettings(screenModel: ReaderSettingsScreenMod
FilterChip(
selected = imageScaleType == index + 1,
onClick = { screenModel.preferences.imageScaleType().set(index + 1) },
label = { Text(localize(it)) },
label = { Text(stringResource(it)) },
)
}
}
@@ -88,48 +88,48 @@ private fun ColumnScope.PagerViewerSettings(screenModel: ReaderSettingsScreenMod
FilterChip(
selected = zoomStart == index + 1,
onClick = { screenModel.preferences.zoomStart().set(index + 1) },
label = { Text(localize(it)) },
label = { Text(stringResource(it)) },
)
}
}
CheckboxItem(
label = localize(MR.strings.pref_crop_borders),
label = stringResource(MR.strings.pref_crop_borders),
pref = screenModel.preferences.cropBorders(),
)
CheckboxItem(
label = localize(MR.strings.pref_landscape_zoom),
label = stringResource(MR.strings.pref_landscape_zoom),
pref = screenModel.preferences.landscapeZoom(),
)
CheckboxItem(
label = localize(MR.strings.pref_navigate_pan),
label = stringResource(MR.strings.pref_navigate_pan),
pref = screenModel.preferences.navigateToPan(),
)
val dualPageSplitPaged by screenModel.preferences.dualPageSplitPaged().collectAsState()
CheckboxItem(
label = localize(MR.strings.pref_dual_page_split),
label = stringResource(MR.strings.pref_dual_page_split),
pref = screenModel.preferences.dualPageSplitPaged(),
)
if (dualPageSplitPaged) {
CheckboxItem(
label = localize(MR.strings.pref_dual_page_invert),
label = stringResource(MR.strings.pref_dual_page_invert),
pref = screenModel.preferences.dualPageInvertPaged(),
)
}
val dualPageRotateToFit by screenModel.preferences.dualPageRotateToFit().collectAsState()
CheckboxItem(
label = localize(MR.strings.pref_page_rotate),
label = stringResource(MR.strings.pref_page_rotate),
pref = screenModel.preferences.dualPageRotateToFit(),
)
if (dualPageRotateToFit) {
CheckboxItem(
label = localize(MR.strings.pref_page_rotate_invert),
label = stringResource(MR.strings.pref_page_rotate_invert),
pref = screenModel.preferences.dualPageRotateToFitInvert(),
)
}
@@ -152,7 +152,7 @@ private fun ColumnScope.WebtoonViewerSettings(screenModel: ReaderSettingsScreenM
val webtoonSidePadding by screenModel.preferences.webtoonSidePadding().collectAsState()
SliderItem(
label = localize(MR.strings.pref_webtoon_side_padding),
label = stringResource(MR.strings.pref_webtoon_side_padding),
min = ReaderPreferences.WEBTOON_PADDING_MIN,
max = ReaderPreferences.WEBTOON_PADDING_MAX,
value = webtoonSidePadding,
@@ -163,25 +163,25 @@ private fun ColumnScope.WebtoonViewerSettings(screenModel: ReaderSettingsScreenM
)
CheckboxItem(
label = localize(MR.strings.pref_crop_borders),
label = stringResource(MR.strings.pref_crop_borders),
pref = screenModel.preferences.cropBordersWebtoon(),
)
val dualPageSplitWebtoon by screenModel.preferences.dualPageSplitWebtoon().collectAsState()
CheckboxItem(
label = localize(MR.strings.pref_dual_page_split),
label = stringResource(MR.strings.pref_dual_page_split),
pref = screenModel.preferences.dualPageSplitWebtoon(),
)
if (dualPageSplitWebtoon) {
CheckboxItem(
label = localize(MR.strings.pref_dual_page_invert),
label = stringResource(MR.strings.pref_dual_page_invert),
pref = screenModel.preferences.dualPageInvertWebtoon(),
)
}
CheckboxItem(
label = localize(MR.strings.pref_double_tap_zoom),
label = stringResource(MR.strings.pref_double_tap_zoom),
pref = screenModel.preferences.webtoonDoubleTapZoomEnabled(),
)
}
@@ -198,7 +198,7 @@ private fun ColumnScope.TapZonesItems(
FilterChip(
selected = selected == index,
onClick = { onSelect(index) },
label = { Text(localize(it)) },
label = { Text(stringResource(it)) },
)
}
}
@@ -209,7 +209,7 @@ private fun ColumnScope.TapZonesItems(
FilterChip(
selected = it == invertMode,
onClick = { onSelectInvertMode(it) },
label = { Text(localize(it.titleRes)) },
label = { Text(stringResource(it.titleRes)) },
)
}
}