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
|
|
@ -1,16 +1,8 @@
|
|||
package com.github.damontecres.wholphin.util
|
||||
|
||||
import com.github.damontecres.wholphin.ui.main.HomeSection
|
||||
import org.jellyfin.sdk.model.api.BaseItemKind
|
||||
import org.jellyfin.sdk.model.api.CollectionType
|
||||
|
||||
val supportedHomeSection =
|
||||
setOf(
|
||||
HomeSection.LATEST_MEDIA,
|
||||
HomeSection.NEXT_UP,
|
||||
HomeSection.RESUME,
|
||||
)
|
||||
|
||||
val supportItemKinds =
|
||||
setOf(
|
||||
BaseItemKind.MOVIE,
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class CrashReportSender : ReportSender {
|
|||
val api =
|
||||
createJellyfin {
|
||||
this.context = context
|
||||
clientInfo = AppModule.clientInfo()
|
||||
clientInfo = AppModule.clientInfo(context)
|
||||
deviceInfo = AppModule.deviceInfo(context)
|
||||
apiClientFactory = okHttpFactory
|
||||
socketConnectionFactory = okHttpFactory
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.github.damontecres.wholphin.util
|
||||
|
||||
import android.os.Build
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import com.github.damontecres.wholphin.R
|
||||
|
|
@ -11,6 +12,7 @@ import com.github.damontecres.wholphin.data.model.chooseStream
|
|||
import com.github.damontecres.wholphin.preferences.UserPreferences
|
||||
import com.github.damontecres.wholphin.ui.isNotNullOrBlank
|
||||
import org.jellyfin.sdk.model.api.BaseItemDto
|
||||
import org.jellyfin.sdk.model.api.MediaSegmentType
|
||||
import org.jellyfin.sdk.model.api.MediaStream
|
||||
import org.jellyfin.sdk.model.api.MediaStreamType
|
||||
import java.time.LocalDate
|
||||
|
|
@ -164,3 +166,15 @@ fun formatBytes(
|
|||
}
|
||||
return String.format(Locale.getDefault(), "%.2f%s", count, suffixes[unit])
|
||||
}
|
||||
|
||||
@get:StringRes
|
||||
val MediaSegmentType.stringRes: Int
|
||||
get() =
|
||||
when (this) {
|
||||
MediaSegmentType.UNKNOWN -> R.string.unknown
|
||||
MediaSegmentType.COMMERCIAL -> R.string.commercial
|
||||
MediaSegmentType.PREVIEW -> R.string.preview
|
||||
MediaSegmentType.RECAP -> R.string.recap
|
||||
MediaSegmentType.OUTRO -> R.string.outro
|
||||
MediaSegmentType.INTRO -> R.string.intro
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue