More localization fixes

This commit is contained in:
Arkadiusz Fal 2022-09-27 15:22:40 +02:00
parent c86e9d95d1
commit 7573b0321c
4 changed files with 11 additions and 18 deletions

View File

@ -26,7 +26,7 @@ struct ControlsOverlay: View {
var body: some View {
ScrollView {
VStack {
Section(header: controlsHeader("Rate & Captions")) {
Section(header: controlsHeader("Rate & Captions".localized())) {
HStack(spacing: rateButtonsSpacing) {
decreaseRateButton
#if os(tvOS)
@ -50,14 +50,14 @@ struct ControlsOverlay: View {
#endif
}
Section(header: controlsHeader("Quality Profile")) {
Section(header: controlsHeader("Quality Profile".localized())) {
qualityProfileButton
#if os(tvOS)
.focused($focusedField, equals: .qualityProfile)
#endif
}
Section(header: controlsHeader("Stream & Player")) {
Section(header: controlsHeader("Stream & Player".localized())) {
qualityButton
#if os(tvOS)
.focused($focusedField, equals: .stream)
@ -71,7 +71,7 @@ struct ControlsOverlay: View {
if player.activeBackend == .mpv,
showMPVPlaybackStats
{
Section(header: controlsHeader("Statistics")) {
Section(header: controlsHeader("Statistics".localized())) {
PlaybackStatsView()
}
#if os(tvOS)

View File

@ -14,7 +14,7 @@ struct OpeningStream: View {
}
var reason: String {
guard player.videoBeingOpened != nil else {
guard player.videoBeingOpened == nil else {
return "Loading streams...".localized()
}
@ -22,19 +22,12 @@ struct OpeningStream: View {
return "Opening audio stream...".localized()
}
return String(format: "Opening %@ stream...".localized(), streamQuality)
return String(format: "Opening %@ stream...".localized(), player.streamSelection?.shortQuality ?? "")
}
var state: String? {
player.videoBeingOpened.isNil ? model.bufferingStateText : nil
}
var streamQuality: String {
guard let stream = player.streamSelection else { return " " }
guard !player.musicMode else { return " audio " }
return " \(stream.shortQuality) "
}
}
struct OpeningStream_Previews: PreviewProvider {

View File

@ -7,10 +7,10 @@ struct PlaybackStatsView: View {
var body: some View {
VStack(alignment: .leading, spacing: 6) {
mpvPlaybackStatRow("Hardware decoder", player.mpvBackend.hwDecoder)
mpvPlaybackStatRow("Dropped frames", String(player.mpvBackend.frameDropCount))
mpvPlaybackStatRow("Stream FPS", String(format: "%.2ffps", player.mpvBackend.outputFps))
mpvPlaybackStatRow("Cached time", String(format: "%.2fs", player.mpvBackend.cacheDuration))
mpvPlaybackStatRow("Hardware decoder".localized(), player.mpvBackend.hwDecoder)
mpvPlaybackStatRow("Dropped frames".localized(), String(player.mpvBackend.frameDropCount))
mpvPlaybackStatRow("Stream FPS".localized(), String(format: "%.2ffps", player.mpvBackend.outputFps))
mpvPlaybackStatRow("Cached time".localized(), String(format: "%.2fs", player.mpvBackend.cacheDuration))
}
.padding(.top, 2)
#if os(tvOS)

View File

@ -209,7 +209,7 @@ struct PlayerSettings: View {
}
private var fullScreenPlayerControlsLayoutPicker: some View {
Picker("Fullscreen Size", selection: $fullScreenPlayerControlsLayout) {
Picker("Fullscreen size", selection: $fullScreenPlayerControlsLayout) {
ForEach(PlayerControlsLayout.allCases.filter(\.available), id: \.self) { layout in
Text(layout.description).tag(layout.rawValue)
}