mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Extract strings into resources (#151)
Move all strings into resource files to make future translating easier No user facing changes in this PR
This commit is contained in:
parent
40267be633
commit
2840fa3f2a
52 changed files with 616 additions and 306 deletions
|
|
@ -70,7 +70,11 @@ sealed interface AppPreference<T> {
|
|||
},
|
||||
summarizer = { value ->
|
||||
if (value != null) {
|
||||
"$value seconds"
|
||||
WholphinApplication.instance.resources.getQuantityString(
|
||||
R.plurals.seconds,
|
||||
value.toInt(),
|
||||
value.toInt(),
|
||||
)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
|
@ -95,7 +99,11 @@ sealed interface AppPreference<T> {
|
|||
},
|
||||
summarizer = { value ->
|
||||
if (value != null) {
|
||||
"$value seconds"
|
||||
WholphinApplication.instance.resources.getQuantityString(
|
||||
R.plurals.seconds,
|
||||
value.toInt(),
|
||||
value.toInt(),
|
||||
)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
|
@ -137,7 +145,14 @@ sealed interface AppPreference<T> {
|
|||
setter = { prefs, value ->
|
||||
prefs.updatePlaybackPreferences { controllerTimeoutMs = value }
|
||||
},
|
||||
summarizer = { value -> value?.let { "${value / 1000.0} seconds" } },
|
||||
summarizer = { value ->
|
||||
value?.let {
|
||||
WholphinApplication.instance.getString(
|
||||
R.string.decimal_seconds,
|
||||
value / 1000.0,
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
val SeekBarSteps =
|
||||
|
|
@ -243,7 +258,7 @@ sealed interface AppPreference<T> {
|
|||
},
|
||||
summarizer = { value ->
|
||||
if (value == 0L) {
|
||||
"Disabled"
|
||||
WholphinApplication.instance.getString(R.string.disabled)
|
||||
} else {
|
||||
"${value}s"
|
||||
}
|
||||
|
|
@ -262,10 +277,16 @@ sealed interface AppPreference<T> {
|
|||
prefs.updatePlaybackPreferences { autoPlayNextDelaySeconds = value }
|
||||
},
|
||||
summarizer = { value ->
|
||||
if (value == 0L) {
|
||||
"Immediate"
|
||||
if (value == null) {
|
||||
""
|
||||
} else if (value == 0L) {
|
||||
WholphinApplication.instance.getString(R.string.immediate)
|
||||
} else {
|
||||
"$value seconds"
|
||||
WholphinApplication.instance.resources.getQuantityString(
|
||||
R.plurals.seconds,
|
||||
value.toInt(),
|
||||
value.toInt(),
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
@ -284,10 +305,16 @@ sealed interface AppPreference<T> {
|
|||
}
|
||||
},
|
||||
summarizer = { value ->
|
||||
if (value == 0L) {
|
||||
"Disabled"
|
||||
if (value == null) {
|
||||
""
|
||||
} else if (value == 0L) {
|
||||
WholphinApplication.instance.getString(R.string.disabled)
|
||||
} else {
|
||||
"$value hours"
|
||||
WholphinApplication.instance.resources.getQuantityString(
|
||||
R.plurals.hours,
|
||||
value.toInt(),
|
||||
value.toInt(),
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
@ -485,7 +512,7 @@ sealed interface AppPreference<T> {
|
|||
|
||||
val SkipCommercials =
|
||||
AppChoicePreference<SkipSegmentBehavior>(
|
||||
title = R.string.skip_comercials_behavior,
|
||||
title = R.string.skip_commercials_behavior,
|
||||
defaultValue = SkipSegmentBehavior.ASK_TO_SKIP,
|
||||
getter = { it.playbackPreferences.skipCommercials },
|
||||
setter = { prefs, value ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue