Localizations

This commit is contained in:
Arkadiusz Fal
2022-09-04 17:28:30 +02:00
parent 2d51f6adff
commit b66e177114
33 changed files with 2180 additions and 122 deletions

View File

@@ -3,7 +3,7 @@ import Foundation
import SwiftUI
struct Buffering: View {
var reason = "Buffering stream..."
var reason = "Buffering stream...".localized()
var state: String?
#if os(iOS)

View File

@@ -14,7 +14,15 @@ struct OpeningStream: View {
}
var reason: String {
player.videoBeingOpened.isNil ? "Opening\(streamQuality)stream..." : "Loading streams..."
guard player.videoBeingOpened != nil else {
return "Loading streams...".localized()
}
if player.musicMode {
return "Opening audio stream...".localized()
}
return String(format: "Opening %@ stream...".localized(), streamQuality)
}
var state: String? {

View File

@@ -45,11 +45,11 @@ enum PlayerControlsLayout: String, CaseIterable, Defaults.Serializable {
var description: String {
switch self {
case .tvRegular:
return "TV"
return "TV".localized()
case .veryLarge:
return "Very Large"
return "Very Large".localized()
default:
return rawValue.capitalized
return rawValue.capitalized.localized()
}
}

View File

@@ -70,11 +70,26 @@ struct VideoDetails: View {
)
HStack(spacing: 4) {
pageButton("Info", "info.circle", .info, !video.isNil)
pageButton("Chapters", "bookmark", .chapters, !(video?.chapters.isEmpty ?? true))
pageButton("Comments", "text.bubble", .comments, !video.isNil) { comments.load() }
pageButton("Related", "rectangle.stack.fill", .related, !video.isNil)
pageButton("Queue", "list.number", .queue, !player.queue.isEmpty)
pageButton(
"Info".localized(),
"info.circle", .info, !video.isNil
)
pageButton(
"Chapters".localized(),
"bookmark", .chapters, !(video?.chapters.isEmpty ?? true)
)
pageButton(
"Comments".localized(),
"text.bubble", .comments, !video.isNil
) { comments.load() }
pageButton(
"Related".localized(),
"rectangle.stack.fill", .related, !video.isNil
)
pageButton(
"Queue".localized(),
"list.number", .queue, !player.queue.isEmpty
)
}
.onChange(of: player.currentItem) { _ in
page.update(.moveToFirst)

View File

@@ -328,6 +328,7 @@ struct VideoPlayerView: View {
if !fullScreenPlayer {
VideoDetails(sidebarQueue: sidebarQueue, fullScreen: $fullScreenDetails)
#if os(iOS)
// .zIndex(-1)
.ignoresSafeArea(.all, edges: .bottom)
#endif
.background(colorScheme == .dark ? Color.black : Color.white)