Fix locales

This commit is contained in:
Arkadiusz Fal
2026-02-09 00:13:46 +01:00
parent 05f921d605
commit 8464464199
55 changed files with 644 additions and 548 deletions

View File

@@ -35,7 +35,7 @@ struct ChaptersView: View {
Button(role: .cancel) {
dismiss()
} label: {
Label("Close", systemImage: "xmark")
Label(String(localized: "common.close"), systemImage: "xmark")
.labelStyle(.iconOnly)
}
}

View File

@@ -602,7 +602,7 @@ struct ControlsSectionRenderer: View {
Circle()
.fill(.red)
.frame(width: 6, height: 6)
Text("LIVE")
Text(String(localized: "player.live"))
.font(.caption.weight(.semibold))
.foregroundStyle(.red)
}
@@ -622,7 +622,7 @@ struct ControlsSectionRenderer: View {
.font(timeFont)
.foregroundStyle(.white)
Text(" / ")
Text(verbatim: " / ")
.font(timeFont)
.foregroundStyle(.white.opacity(0.7))
@@ -638,7 +638,7 @@ struct ControlsSectionRenderer: View {
.font(timeFont)
.foregroundStyle(.white)
Text(" / ")
Text(verbatim: " / ")
.font(timeFont)
.foregroundStyle(.white.opacity(0.7))
@@ -653,11 +653,11 @@ struct ControlsSectionRenderer: View {
.font(timeFont)
.foregroundStyle(.white)
Text(" / ")
Text(verbatim: " / ")
.font(timeFont)
.foregroundStyle(.white.opacity(0.7))
Text("-\(formattedRemainingTime)")
Text(verbatim: "-\(formattedRemainingTime)")
.font(timeFont)
.foregroundStyle(.white.opacity(0.7))
}
@@ -669,11 +669,11 @@ struct ControlsSectionRenderer: View {
.font(timeFont)
.foregroundStyle(.white)
Text(" / ")
Text(verbatim: " / ")
.font(timeFont)
.foregroundStyle(.white.opacity(0.7))
Text("-\(formattedRemainingTime)")
Text(verbatim: "-\(formattedRemainingTime)")
.font(timeFont)
.foregroundStyle(.white.opacity(0.7))
}

View File

@@ -1486,17 +1486,17 @@ extension ExpandedPlayerSheet {
.overlay(alignment: panelSide == .right ? .topLeading : .topTrailing) {
if appEnvironment?.settingsManager.showPlayerAreaDebug == true {
VStack(alignment: .leading, spacing: 2) {
Text("Layout (yellow):")
Text(verbatim: "Layout (yellow):")
.fontWeight(.bold)
Text("leadSA: \(Int(leadingSafeArea)) trailSA: \(Int(trailingSafeArea))")
Text("availW: \(Int(availableWidth)) fullW: \(Int(fullWidth))")
Text("fullH: \(Int(fullHeight)) offset: \(Int(controlsOffset))")
Text("pinned: \(isPanelPinned ? "Y" : "N") vis: \(isPanelVisible ? "Y" : "N") side: \(panelSide == .left ? "L" : "R")")
Text(verbatim: "leadSA: \(Int(leadingSafeArea)) trailSA: \(Int(trailingSafeArea))")
Text(verbatim: "availW: \(Int(availableWidth)) fullW: \(Int(fullWidth))")
Text(verbatim: "fullH: \(Int(fullHeight)) offset: \(Int(controlsOffset))")
Text(verbatim: "pinned: \(isPanelPinned ? "Y" : "N") vis: \(isPanelVisible ? "Y" : "N") side: \(panelSide == .left ? "L" : "R")")
#if os(iOS)
let orientation = UIApplication.shared.connectedScenes
.compactMap { $0 as? UIWindowScene }
.first?.interfaceOrientation
Text("orient: \(orientation == .landscapeLeft ? "LL" : orientation == .landscapeRight ? "LR" : "P")")
Text(verbatim: "orient: \(orientation == .landscapeLeft ? "LL" : orientation == .landscapeRight ? "LR" : "P")")
#endif
}
.font(.system(size: 9, weight: .medium, design: .monospaced))

View File

@@ -105,11 +105,11 @@ struct MPVDebugOverlay: View {
// Header with close button (non-tvOS only - tvOS has button at bottom)
HStack(spacing: 4) {
#if os(tvOS)
Text("MPV Debug Stats")
Text(String(localized: "player.debug.stats"))
.font(.system(size: headerSize, weight: .semibold, design: .monospaced))
.foregroundStyle(primaryTextColor)
#else
Text(isLandscape ? "MPV Debug" : "Debug")
Text(String(localized: isLandscape ? "player.debug.title" : "player.debug.titleShort"))
.font(.system(size: headerSize, weight: .semibold, design: .monospaced))
.foregroundStyle(primaryTextColor)
@@ -168,7 +168,7 @@ struct MPVDebugOverlay: View {
HStack(spacing: 12) {
Image(systemName: "xmark.circle")
.font(.system(size: closeButtonSize))
Text("Close")
Text(String(localized: "common.close"))
.font(.system(size: rowSize, weight: .medium))
}
.foregroundStyle(.white)

View File

@@ -612,14 +612,14 @@ struct PlayerControlsView: View {
// Position at bottom-left to avoid overlap with yellow layout debug
if showPlayerAreaDebug {
VStack(alignment: .leading, spacing: 2) {
Text("Controls (cyan):")
Text(verbatim: "Controls (cyan):")
.fontWeight(.bold)
Text("winSA T:\(Int(safeArea.top)) B:\(Int(safeArea.bottom)) L:\(Int(safeArea.left)) R:\(Int(safeArea.right))")
Text("topPad: \(Int(topPadding)) btmPad: \(Int(bottomPadding)) wide: \(isWideScreenLayout ? "Y" : "N")")
Text("geom W:\(Int(geometry.size.width)) H:\(Int(geometry.size.height))")
Text("vidTop: \(Int(effectiveVideoTop)) vidH: \(Int(effectiveVideoHeight))")
Text("centerOff: \(Int(centerYOffset)) btmExtra: \(Int(bottomExtraPadding))")
Text("vis: \(isPanelVisible ? "Y" : "N") fitH: \(Int(videoFitHeight ?? -1)) effVH: \(Int(effectiveVideoHeight))")
Text(verbatim: "winSA T:\(Int(safeArea.top)) B:\(Int(safeArea.bottom)) L:\(Int(safeArea.left)) R:\(Int(safeArea.right))")
Text(verbatim: "topPad: \(Int(topPadding)) btmPad: \(Int(bottomPadding)) wide: \(isWideScreenLayout ? "Y" : "N")")
Text(verbatim: "geom W:\(Int(geometry.size.width)) H:\(Int(geometry.size.height))")
Text(verbatim: "vidTop: \(Int(effectiveVideoTop)) vidH: \(Int(effectiveVideoHeight))")
Text(verbatim: "centerOff: \(Int(centerYOffset)) btmExtra: \(Int(bottomExtraPadding))")
Text(verbatim: "vis: \(isPanelVisible ? "Y" : "N") fitH: \(Int(videoFitHeight ?? -1)) effVH: \(Int(effectiveVideoHeight))")
}
.font(.system(size: 9, weight: .medium, design: .monospaced))
.foregroundStyle(.cyan)

View File

@@ -117,7 +117,7 @@ struct ErrorDetailsSheet: View {
Button(role: .cancel) {
dismiss()
} label: {
Label("Close", systemImage: "xmark")
Label(String(localized: "common.close"), systemImage: "xmark")
.labelStyle(.iconOnly)
}
}

View File

@@ -52,7 +52,7 @@ struct DownloadedVideoRowView: View {
@ViewBuilder
private var codecBadge: some View {
if isMuxed {
Text("STREAM")
Text(String(localized: "stream.badge.stream"))
.font(.caption2)
.padding(.horizontal, 6)
.padding(.vertical, 2)

View File

@@ -36,7 +36,7 @@ struct AdaptiveStreamRowView: View {
HStack {
VStack(alignment: .leading, spacing: 2) {
HStack(spacing: 6) {
Text(format == .hls ? "HLS" : "DASH")
Text(String(localized: format == .hls ? "stream.format.hls" : "stream.format.dash"))
.font(.headline)
// Show quality badge when available
@@ -49,7 +49,7 @@ struct AdaptiveStreamRowView: View {
.clipShape(Capsule())
}
}
Text(format == .hls ? "Apple HLS" : "MPEG-DASH (Best for MPV)")
Text(String(localized: format == .hls ? "stream.format.appleHLS" : "stream.format.mpegDash"))
.font(.caption)
.foregroundStyle(.secondary)
}
@@ -134,7 +134,7 @@ struct VideoStreamRowView: View {
@ViewBuilder
private var codecBadge: some View {
if stream.isMuxed {
Text("STREAM")
Text(String(localized: "stream.badge.stream"))
.font(.caption2)
.padding(.horizontal, 6)
.padding(.vertical, 2)
@@ -359,7 +359,7 @@ struct CaptionRowView: View {
.font(.headline)
if let caption, caption.isAutoGenerated {
Text("AUTO")
Text(String(localized: "stream.subtitle.auto"))
.font(.caption2)
.padding(.horizontal, 6)
.padding(.vertical, 2)

View File

@@ -194,7 +194,7 @@ struct QualitySelectorView: View {
Button(role: .cancel) {
dismiss()
} label: {
Label("Close", systemImage: "xmark")
Label(String(localized: "common.close"), systemImage: "xmark")
.labelStyle(.iconOnly)
}
}

View File

@@ -45,7 +45,7 @@ struct QueueManagementSheet: View {
Button(role: .cancel) {
dismiss()
} label: {
Label("Close", systemImage: "xmark")
Label(String(localized: "common.close"), systemImage: "xmark")
.labelStyle(.iconOnly)
}
}

View File

@@ -214,7 +214,7 @@ struct MacOSControlBar: View {
Circle()
.fill(.red)
.frame(width: 6, height: 6)
Text("LIVE")
Text(String(localized: "player.live"))
.font(.system(size: 11, weight: .semibold))
.foregroundStyle(.red)
}

View File

@@ -185,7 +185,7 @@ struct TVDetailsPanel: View {
// Subscriber count
if let subscriberCount = video?.author.subscriberCount {
Text("\(CountFormatter.compact(subscriberCount)) subscribers")
Text("channel.subscriberCount \(CountFormatter.compact(subscriberCount))")
.font(.subheadline)
.foregroundStyle(.white.opacity(0.6))
}
@@ -200,7 +200,7 @@ struct TVDetailsPanel: View {
navigateToChannel(video.author)
}
} label: {
Text("View Channel")
Text(String(localized: "channel.view"))
.font(.callout)
.fontWeight(.medium)
}
@@ -272,7 +272,7 @@ struct TVDetailsPanel: View {
)
.padding(.vertical, 16)
} else {
Text("Comments unavailable")
Text(String(localized: "comments.unavailable"))
.font(.body)
.foregroundStyle(.white.opacity(0.5))
.frame(maxWidth: .infinity, alignment: .center)
@@ -476,7 +476,7 @@ struct TVCommentsListView: View {
Image(systemName: "bubble.left.and.exclamationmark.bubble.right")
.font(.title2)
.foregroundStyle(.white.opacity(0.5))
Text("Comments disabled")
Text(String(localized: "comments.disabled"))
.font(.subheadline)
.foregroundStyle(.white.opacity(0.5))
}
@@ -506,7 +506,7 @@ struct TVCommentsListView: View {
Image(systemName: "bubble.left.and.bubble.right")
.font(.title2)
.foregroundStyle(.white.opacity(0.5))
Text("No comments")
Text(String(localized: "comments.empty"))
.font(.subheadline)
.foregroundStyle(.white.opacity(0.5))
}
@@ -707,7 +707,7 @@ struct TVFocusableCommentView: View {
HStack(spacing: 4) {
Image(systemName: showReplies ? "chevron.up" : "chevron.down")
.font(.caption2)
Text("\(comment.replyCount) replies")
Text("comments.replyCount \(comment.replyCount)")
.font(.caption)
}
.foregroundStyle(.blue)
@@ -749,7 +749,7 @@ struct TVFocusableCommentView: View {
Button {
Task { await loadReplies() }
} label: {
Text("Load more replies")
Text(String(localized: "comments.loadMoreReplies"))
.font(.caption)
.foregroundStyle(.blue)
}

View File

@@ -233,7 +233,7 @@ struct TVPlayerControlsView: View {
VStack(spacing: 6) {
Image(systemName: "captions.bubble")
.font(.system(size: 28))
Text("Subtitles")
Text(String(localized: "player.controls.subtitles"))
.font(.caption)
}
}
@@ -247,7 +247,7 @@ struct TVPlayerControlsView: View {
VStack(spacing: 6) {
Image(systemName: "ant.circle")
.font(.system(size: 28))
Text("Debug")
Text(String(localized: "player.debug.titleShort"))
.font(.caption)
}
}
@@ -281,7 +281,7 @@ struct TVPlayerControlsView: View {
VStack(spacing: 6) {
Image(systemName: "speaker.minus")
.font(.system(size: 28))
Text("Vol -")
Text(String(localized: "player.tvos.volumeDown"))
.font(.caption)
}
}
@@ -299,7 +299,7 @@ struct TVPlayerControlsView: View {
VStack(spacing: 6) {
Image(systemName: "speaker.plus")
.font(.system(size: 28))
Text("Vol +")
Text(String(localized: "player.tvos.volumeUp"))
.font(.caption)
}
}

View File

@@ -155,7 +155,7 @@ struct TVPlayerProgressBar: View {
Circle()
.fill(.red)
.frame(width: 8, height: 8)
Text("LIVE")
Text(String(localized: "player.live"))
.font(.subheadline.weight(.semibold))
.foregroundStyle(.red)
}
@@ -171,11 +171,11 @@ struct TVPlayerProgressBar: View {
// Scrub hint when focused (only for non-live)
if !isLive && isFocused && !isScrubbing {
Text("Press to scrub")
Text(String(localized: "player.tvos.scrubHint"))
.font(.caption)
.foregroundStyle(.white.opacity(0.5))
} else if !isLive && isScrubbing {
Text("Swipe ← → • press to seek")
Text(String(localized: "player.tvos.seekHint"))
.font(.caption)
.foregroundStyle(.white.opacity(0.7))
}