From 5ff71b4a69c82d896e756887953de79fc3a054a0 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 13 Dec 2024 12:17:45 -0700 Subject: [PATCH] Update Existing Strings to Localizations --- Shared/Extensions/JellyfinAPI/DeviceType.swift | 2 +- .../Extensions/JellyfinAPI/MediaStream.swift | 10 +++++----- Shared/Objects/CustomDeviceProfileAction.swift | 2 +- Shared/Objects/GestureAction.swift | 16 ++++++++-------- Shared/Objects/ItemFilter/ItemFilterType.swift | 4 ++-- Shared/Objects/ItemFilter/ItemSortBy.swift | 8 ++++---- Shared/Objects/OverlayType.swift | 2 +- Shared/Objects/StreamType.swift | 4 ++-- Shared/Objects/TimeStampType.swift | 2 +- Shared/Objects/UserAccessPolicy.swift | 4 ++-- Shared/Objects/VideoPlayerActionButton.swift | 18 +++++++++--------- .../OrderedSectionSelectorView.swift | 4 ++-- Swiftfin tvOS/Views/BasicAppSettingsView.swift | 8 ++++---- .../Components/SpecialFeaturesHStack.swift | 2 +- .../Components/AddUserButton.swift | 4 ++-- .../Components/ServerSelectionMenu.swift | 2 +- .../Components/UserGridButton.swift | 2 +- .../Components/CustomProfileButton.swift | 2 +- .../EditCustomDeviceProfileView.swift | 4 ++-- .../CustomDeviceProfileSettingsView.swift | 4 ++-- .../Components/ListColumnsPickerView.swift | 2 +- .../VideoPlayer/Components/LoadingView.swift | 4 ++-- .../Overlays/SmallMenuOverlay.swift | 6 +++--- .../Views/VideoPlayer/VideoPlayer.swift | 2 +- Swiftfin/Views/AppLoadingView.swift | 2 +- .../AppSettingsView/AppSettingsView.swift | 4 ++-- .../ChannelLibraryView.swift | 2 +- Swiftfin/Views/EditServerView.swift | 6 +++--- .../Components/LibraryViewTypeToggle.swift | 6 +++--- .../Components/AddUserButton.swift | 4 ++-- .../SelectUserView/Components/AddUserRow.swift | 2 +- .../Components/ServerSelectionMenu.swift | 10 +++++----- .../Components/UserGridButton.swift | 2 +- .../SelectUserView/Components/UserRow.swift | 2 +- .../Components/CustomProfileButton.swift | 2 +- .../EditCustomDeviceProfileView.swift | 4 ++-- .../SettingsView/GestureSettingsView.swift | 2 +- .../NativeVideoPlayerSettingsView.swift | 6 +++--- .../UserProfileSettingsView.swift | 8 ++++---- .../Components/Sections/SubtitleSection.swift | 2 +- .../Components/UserSignInSecurityView.swift | 16 ++++++++-------- 41 files changed, 99 insertions(+), 99 deletions(-) diff --git a/Shared/Extensions/JellyfinAPI/DeviceType.swift b/Shared/Extensions/JellyfinAPI/DeviceType.swift index 0c102c82b..48a94ce45 100644 --- a/Shared/Extensions/JellyfinAPI/DeviceType.swift +++ b/Shared/Extensions/JellyfinAPI/DeviceType.swift @@ -73,7 +73,7 @@ enum DeviceType: String, Displayable, Codable, CaseIterable { case .xbox: return "Xbox" case .other: - return "Other" + return L10n.other } } diff --git a/Shared/Extensions/JellyfinAPI/MediaStream.swift b/Shared/Extensions/JellyfinAPI/MediaStream.swift index 7b702acf9..a5932e765 100644 --- a/Shared/Extensions/JellyfinAPI/MediaStream.swift +++ b/Shared/Extensions/JellyfinAPI/MediaStream.swift @@ -51,7 +51,7 @@ extension MediaStream { var properties: [TextPair] = [] if let value = type { - properties.append(.init(title: "Type", subtitle: value.rawValue)) + properties.append(.init(title: L10n.type, subtitle: value.rawValue)) } if let value = codec { @@ -63,7 +63,7 @@ extension MediaStream { } if let value = language { - properties.append(.init(title: "Language", subtitle: value)) + properties.append(.init(title: L10n.language, subtitle: value)) } if let value = timeBase { @@ -107,7 +107,7 @@ extension MediaStream { } if let value = channels { - properties.append(.init(title: "Channels", subtitle: value.description)) + properties.append(.init(title: L10n.channels, subtitle: value.description)) } if let value = sampleRate { @@ -115,7 +115,7 @@ extension MediaStream { } if let value = isDefault { - properties.append(.init(title: "Default", subtitle: value.description)) + properties.append(.init(title: L10n.default, subtitle: value.description)) } if let value = isForced { @@ -195,7 +195,7 @@ extension MediaStream { } if let value = deliveryURL { - properties.append(.init(title: "URL", subtitle: value)) + properties.append(.init(title: L10n.url, subtitle: value)) } if let value = deliveryURL { diff --git a/Shared/Objects/CustomDeviceProfileAction.swift b/Shared/Objects/CustomDeviceProfileAction.swift index b43db7723..f59fe94fa 100644 --- a/Shared/Objects/CustomDeviceProfileAction.swift +++ b/Shared/Objects/CustomDeviceProfileAction.swift @@ -17,7 +17,7 @@ enum CustomDeviceProfileAction: String, CaseIterable, Displayable, Storable { var displayTitle: String { switch self { case .add: - return "Add" + return L10n.add case .replace: return "Replace" } diff --git a/Shared/Objects/GestureAction.swift b/Shared/Objects/GestureAction.swift index eeb1ee6a5..de4e37b17 100644 --- a/Shared/Objects/GestureAction.swift +++ b/Shared/Objects/GestureAction.swift @@ -41,7 +41,7 @@ enum MultiTapAction: String, GestureAction { case .none: return L10n.none case .jump: - return "Jump" + return L10n.jump } } } @@ -58,11 +58,11 @@ enum DoubleTouchAction: String, GestureAction { case .none: return L10n.none case .aspectFill: - return "Aspect Fill" + return L10n.aspectFill case .gestureLock: return "Gesture Lock" case .pausePlay: - return "Pause/Play" + return L10n.playAndPause } } } @@ -83,17 +83,17 @@ enum PanAction: String, GestureAction { case .none: return L10n.none case .audioffset: - return "Audio Offset" + return L10n.audioOffset case .brightness: return "Brightness" case .playbackSpeed: - return "Playback Speed" + return L10n.playbackSpeed case .scrub: return "Scrub" case .slowScrub: return "Slow Scrub" case .subtitleOffset: - return "Subtitle Offset" + return L10n.subtitleOffset case .volume: return "Volume" } @@ -110,7 +110,7 @@ enum PinchAction: String, GestureAction { case .none: return L10n.none case .aspectFill: - return "Aspect Fill" + return L10n.aspectFill } } } @@ -125,7 +125,7 @@ enum SwipeAction: String, GestureAction { case .none: return L10n.none case .jump: - return "Jump" + return L10n.jump } } } diff --git a/Shared/Objects/ItemFilter/ItemFilterType.swift b/Shared/Objects/ItemFilter/ItemFilterType.swift index 448bbd969..9547c58b1 100644 --- a/Shared/Objects/ItemFilter/ItemFilterType.swift +++ b/Shared/Objects/ItemFilter/ItemFilterType.swift @@ -55,7 +55,7 @@ extension ItemFilterType: Displayable { case .genres: L10n.genres case .letter: - "Letter" + L10n.letter case .sortBy: L10n.sort case .sortOrder: @@ -65,7 +65,7 @@ extension ItemFilterType: Displayable { case .traits: L10n.filters case .years: - "Years" + L10n.years } } } diff --git a/Shared/Objects/ItemFilter/ItemSortBy.swift b/Shared/Objects/ItemFilter/ItemSortBy.swift index f04649ca6..c0eb0dbb4 100644 --- a/Shared/Objects/ItemFilter/ItemSortBy.swift +++ b/Shared/Objects/ItemFilter/ItemSortBy.swift @@ -22,13 +22,13 @@ enum ItemSortBy: String, CaseIterable, Displayable, Codable { var displayTitle: String { switch self { case .premiereDate: - return "Premiere date" + return L10n.premiereDate case .name: - return "Name" + return L10n.name case .dateAdded: - return "Date added" + return L10n.dateAdded case .random: - return "Random" + return L10n.random } } } diff --git a/Shared/Objects/OverlayType.swift b/Shared/Objects/OverlayType.swift index bb72c912f..b83787f26 100644 --- a/Shared/Objects/OverlayType.swift +++ b/Shared/Objects/OverlayType.swift @@ -34,7 +34,7 @@ enum PlaybackButtonType: String, CaseIterable, Displayable, Defaults.Serializabl case .large: return "Large" case .compact: - return "Compact" + return L10n.compact } } } diff --git a/Shared/Objects/StreamType.swift b/Shared/Objects/StreamType.swift index 8241b696c..e715db8a1 100644 --- a/Shared/Objects/StreamType.swift +++ b/Shared/Objects/StreamType.swift @@ -17,9 +17,9 @@ enum StreamType: String, Displayable { var displayTitle: String { switch self { case .direct: - return "Direct" + return L10n.direct case .transcode: - return "Transcode" + return L10n.transcode case .hls: return "HLS" } diff --git a/Shared/Objects/TimeStampType.swift b/Shared/Objects/TimeStampType.swift index a41e7b22f..2ed77a7bb 100644 --- a/Shared/Objects/TimeStampType.swift +++ b/Shared/Objects/TimeStampType.swift @@ -19,7 +19,7 @@ enum TimestampType: String, CaseIterable, Defaults.Serializable, Displayable { case .split: return "Split" case .compact: - return "Compact" + return L10n.compact } } } diff --git a/Shared/Objects/UserAccessPolicy.swift b/Shared/Objects/UserAccessPolicy.swift index 96c23bf50..d9783d070 100644 --- a/Shared/Objects/UserAccessPolicy.swift +++ b/Shared/Objects/UserAccessPolicy.swift @@ -21,11 +21,11 @@ enum UserAccessPolicy: String, CaseIterable, Codable, Displayable { var displayTitle: String { switch self { case .none: - "None" + L10n.none case .requireDeviceAuthentication: "Device Authentication" case .requirePin: - "Pin" + L10n.pin } } } diff --git a/Shared/Objects/VideoPlayerActionButton.swift b/Shared/Objects/VideoPlayerActionButton.swift index 97448e0ca..fa9a5bb9e 100644 --- a/Shared/Objects/VideoPlayerActionButton.swift +++ b/Shared/Objects/VideoPlayerActionButton.swift @@ -25,23 +25,23 @@ enum VideoPlayerActionButton: String, CaseIterable, Defaults.Serializable, Displ var displayTitle: String { switch self { // case .advanced: -// return "Advanced" +// return L10n.advanced case .aspectFill: - return "Aspect Fill" + return L10n.aspectFill case .audio: - return "Audio" + return L10n.audio case .autoPlay: - return "Auto Play" + return L10n.autoPlay case .chapters: - return "Chapters" + return L10n.chapters case .playbackSpeed: - return "Playback Speed" + return L10n.playbackSpeed case .playNextItem: - return "Play Next Item" + return L10n.playNextItem case .playPreviousItem: - return "Play Previous Item" + return L10n.playPreviousItem case .subtitles: - return "Subtitles" + return L10n.subtitles } } diff --git a/Swiftfin tvOS/Components/OrderedSectionSelectorView.swift b/Swiftfin tvOS/Components/OrderedSectionSelectorView.swift index cc9effe64..d320123cb 100644 --- a/Swiftfin tvOS/Components/OrderedSectionSelectorView.swift +++ b/Swiftfin tvOS/Components/OrderedSectionSelectorView.swift @@ -64,13 +64,13 @@ struct OrderedSectionSelectorView: View { Text(L10n.enabled) Spacer() if editMode?.wrappedValue.isEditing ?? false { - Button("Done") { + Button(L10n.done) { withAnimation { editMode?.wrappedValue = .inactive } } } else { - Button("Edit") { + Button(L10n.edit) { withAnimation { editMode?.wrappedValue = .active } diff --git a/Swiftfin tvOS/Views/BasicAppSettingsView.swift b/Swiftfin tvOS/Views/BasicAppSettingsView.swift index 2ea0642a8..e007f2b9d 100644 --- a/Swiftfin tvOS/Views/BasicAppSettingsView.swift +++ b/Swiftfin tvOS/Views/BasicAppSettingsView.swift @@ -51,7 +51,7 @@ struct AppSettingsView: View { // ) // } // -// ChevronButton("Logs") +// ChevronButton(L10n.logs) // .onSelect { // router.route(to: \.log) // } @@ -68,7 +68,7 @@ struct AppSettingsView: View { // Button { // removeAllServersSelected = true // } label: { -// Text("Remove All Servers") +// Text(L10n.removeAllServers) // } // } // } @@ -79,9 +79,9 @@ struct AppSettingsView: View { //// viewModel.resetUserSettings() // } // } message: { -// Text("Reset all settings back to defaults.") +// Text(L10n.resetAllSettings) // } -// .alert("Remove All Servers", isPresented: $removeAllServersSelected) { +// .alert(L10n.removeAllServers, isPresented: $removeAllServersSelected) { // Button(L10n.reset, role: .destructive) { //// viewModel.removeAllServers() // } diff --git a/Swiftfin tvOS/Views/ItemView/Components/SpecialFeaturesHStack.swift b/Swiftfin tvOS/Views/ItemView/Components/SpecialFeaturesHStack.swift index d3abbf7d0..868cf397d 100644 --- a/Swiftfin tvOS/Views/ItemView/Components/SpecialFeaturesHStack.swift +++ b/Swiftfin tvOS/Views/ItemView/Components/SpecialFeaturesHStack.swift @@ -20,7 +20,7 @@ extension ItemView { var body: some View { PosterHStack( - title: "Special Features", + title: L10n.specialFeatures, type: .landscape, items: items ) diff --git a/Swiftfin tvOS/Views/SelectUserView/Components/AddUserButton.swift b/Swiftfin tvOS/Views/SelectUserView/Components/AddUserButton.swift index 1391e34ed..aad19c6ae 100644 --- a/Swiftfin tvOS/Views/SelectUserView/Components/AddUserButton.swift +++ b/Swiftfin tvOS/Views/SelectUserView/Components/AddUserButton.swift @@ -62,13 +62,13 @@ extension SelectUserView { .buttonBorderShape(.circleBackport) .disabled(!isEnabled) - Text("Add User") + Text(L10n.addUser) .font(.title3) .fontWeight(.semibold) .foregroundStyle(isEnabled ? .primary : .secondary) if serverSelection == .all { - Text("Hidden") + Text(L10n.hidden) .font(.footnote) .hidden() } diff --git a/Swiftfin tvOS/Views/SelectUserView/Components/ServerSelectionMenu.swift b/Swiftfin tvOS/Views/SelectUserView/Components/ServerSelectionMenu.swift index 91cc45a91..03f86d16b 100644 --- a/Swiftfin tvOS/Views/SelectUserView/Components/ServerSelectionMenu.swift +++ b/Swiftfin tvOS/Views/SelectUserView/Components/ServerSelectionMenu.swift @@ -56,7 +56,7 @@ extension SelectUserView { Group { switch serverSelection { case .all: - Label("All Servers", systemImage: "person.2.fill") + Label(L10n.allServers, systemImage: "person.2.fill") case let .server(id): if let server = viewModel.servers.keys.first(where: { $0.id == id }) { Label(server.name, systemImage: "server.rack") diff --git a/Swiftfin tvOS/Views/SelectUserView/Components/UserGridButton.swift b/Swiftfin tvOS/Views/SelectUserView/Components/UserGridButton.swift index ff961e558..ead41f4cb 100644 --- a/Swiftfin tvOS/Views/SelectUserView/Components/UserGridButton.swift +++ b/Swiftfin tvOS/Views/SelectUserView/Components/UserGridButton.swift @@ -87,7 +87,7 @@ extension SelectUserView { .buttonStyle(.card) .buttonBorderShape(.circleBackport) // .contextMenu { - // Button("Delete", role: .destructive) { + // Button(L10n.delete, role: .destructive) { // onDelete() // } // } diff --git a/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/Components/CustomProfileButton.swift b/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/Components/CustomProfileButton.swift index 6d3284a2c..ccb04af03 100644 --- a/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/Components/CustomProfileButton.swift +++ b/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/Components/CustomProfileButton.swift @@ -48,7 +48,7 @@ extension CustomDeviceProfileSettingsView { profileDetailsView( title: L10n.useAsTranscodingProfile, - detail: profile.useAsTranscodingProfile ? "Yes" : "No" + detail: profile.useAsTranscodingProfile ? L10n.yes : L10n.no ) } diff --git a/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/Components/EditCustomDeviceProfileView.swift b/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/Components/EditCustomDeviceProfileView.swift index 2f0ead287..8abfb342b 100644 --- a/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/Components/EditCustomDeviceProfileView.swift +++ b/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/Components/EditCustomDeviceProfileView.swift @@ -95,7 +95,7 @@ extension CustomDeviceProfileSettingsView { HStack { Text(L10n.customProfile) Spacer() - Button("Save") { + Button(L10n.save) { if createProfile { customDeviceProfiles.append(profile.value) } @@ -135,7 +135,7 @@ extension CustomDeviceProfileSettingsView { } .navigationTitle(L10n.customProfile) .alert("Profile not saved", isPresented: $isPresentingNotSaved) { - Button("Close", role: .destructive) { + Button(L10n.close, role: .destructive) { router.dismissCoordinator() } } diff --git a/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/CustomDeviceProfileSettingsView.swift b/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/CustomDeviceProfileSettingsView.swift index f9295912c..df74872b7 100644 --- a/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/CustomDeviceProfileSettingsView.swift +++ b/Swiftfin tvOS/Views/SettingsView/CustomDeviceProfileSettingsView/CustomDeviceProfileSettingsView.swift @@ -82,7 +82,7 @@ struct CustomDeviceProfileSettingsView: View { Button(role: .destructive) { deleteProfile(profile) } label: { - Label("Delete", systemImage: "trash") + Label(L10n.delete, systemImage: "trash") } } } @@ -93,7 +93,7 @@ struct CustomDeviceProfileSettingsView: View { Text(L10n.profiles) Spacer() if customProfiles.isNotEmpty { - Button("Add") { + Button(L10n.add) { router.route(to: \.createCustomDeviceProfile) } } diff --git a/Swiftfin tvOS/Views/SettingsView/CustomizeViewsSettings/Components/ListColumnsPickerView.swift b/Swiftfin tvOS/Views/SettingsView/CustomizeViewsSettings/Components/ListColumnsPickerView.swift index 9d6caa0fd..07c20aa6a 100644 --- a/Swiftfin tvOS/Views/SettingsView/CustomizeViewsSettings/Components/ListColumnsPickerView.swift +++ b/Swiftfin tvOS/Views/SettingsView/CustomizeViewsSettings/Components/ListColumnsPickerView.swift @@ -16,7 +16,7 @@ struct ListColumnsPickerView: View { var body: some View { StepperView( - title: "Columns", + title: L10n.columns, value: $selection, range: 1 ... 3, step: 1 diff --git a/Swiftfin tvOS/Views/VideoPlayer/Components/LoadingView.swift b/Swiftfin tvOS/Views/VideoPlayer/Components/LoadingView.swift index a578a88e2..90cbfb6be 100644 --- a/Swiftfin tvOS/Views/VideoPlayer/Components/LoadingView.swift +++ b/Swiftfin tvOS/Views/VideoPlayer/Components/LoadingView.swift @@ -22,7 +22,7 @@ extension VideoPlayer { VStack(spacing: 10) { - Text("Retrieving media information") + Text(L10n.retrievingMediaInformation) .foregroundColor(.white) ProgressView() @@ -30,7 +30,7 @@ extension VideoPlayer { Button { router.dismissCoordinator() } label: { - Text("Cancel") + Text(L10n.cancel) .foregroundColor(.red) .padding() .overlay { diff --git a/Swiftfin tvOS/Views/VideoPlayer/Overlays/SmallMenuOverlay.swift b/Swiftfin tvOS/Views/VideoPlayer/Overlays/SmallMenuOverlay.swift index 8b109f537..beabc733e 100644 --- a/Swiftfin tvOS/Views/VideoPlayer/Overlays/SmallMenuOverlay.swift +++ b/Swiftfin tvOS/Views/VideoPlayer/Overlays/SmallMenuOverlay.swift @@ -20,11 +20,11 @@ extension VideoPlayer { var displayTitle: String { switch self { case .audio: - return "Audio" + return L10n.audio case .playbackSpeed: - return "Playback Speed" + return L10n.playbackSpeed case .subtitles: - return "Subtitles" + return L10n.subtitles } } } diff --git a/Swiftfin tvOS/Views/VideoPlayer/VideoPlayer.swift b/Swiftfin tvOS/Views/VideoPlayer/VideoPlayer.swift index 48fe3e0b9..7574f19b4 100644 --- a/Swiftfin tvOS/Views/VideoPlayer/VideoPlayer.swift +++ b/Swiftfin tvOS/Views/VideoPlayer/VideoPlayer.swift @@ -87,7 +87,7 @@ struct VideoPlayer: View { @ViewBuilder private var loadingView: some View { - Text("Retrieving media information") + Text(L10n.retrievingMediaInformation) } var body: some View { diff --git a/Swiftfin/Views/AppLoadingView.swift b/Swiftfin/Views/AppLoadingView.swift index 7103bea5b..2d78617cb 100644 --- a/Swiftfin/Views/AppLoadingView.swift +++ b/Swiftfin/Views/AppLoadingView.swift @@ -27,7 +27,7 @@ struct AppLoadingView: View { } } .topBarTrailing { - Button("Advanced", systemImage: "gearshape.fill") {} + Button(L10n.advanced, systemImage: "gearshape.fill") {} .foregroundStyle(.secondary) .disabled(true) .opacity(didFailMigration ? 0 : 1) diff --git a/Swiftfin/Views/AppSettingsView/AppSettingsView.swift b/Swiftfin/Views/AppSettingsView/AppSettingsView.swift index c3ddc31a6..15e89d4b6 100644 --- a/Swiftfin/Views/AppSettingsView/AppSettingsView.swift +++ b/Swiftfin/Views/AppSettingsView/AppSettingsView.swift @@ -62,10 +62,10 @@ struct AppSettingsView: View { Toggle("Use splashscreen", isOn: $selectUserUseSplashscreen) if selectUserUseSplashscreen { - Picker("Servers", selection: $selectUserAllServersSplashscreen) { + Picker(L10n.servers, selection: $selectUserAllServersSplashscreen) { Section { - Label("Random", systemImage: "dice.fill") + Label(L10n.random, systemImage: "dice.fill") .tag(SelectUserServerSelection.all) } diff --git a/Swiftfin/Views/ChannelLibraryView/ChannelLibraryView.swift b/Swiftfin/Views/ChannelLibraryView/ChannelLibraryView.swift index 23a58bcb7..d9e1e8ea0 100644 --- a/Swiftfin/Views/ChannelLibraryView/ChannelLibraryView.swift +++ b/Swiftfin/Views/ChannelLibraryView/ChannelLibraryView.swift @@ -165,7 +165,7 @@ struct ChannelLibraryView: View { // We repurposed `LibraryDisplayType` but want different labels Picker("Channel Display", selection: $channelDisplayType) { - Label("Compact", systemImage: LibraryDisplayType.grid.systemImage) + Label(L10n.compact, systemImage: LibraryDisplayType.grid.systemImage) .tag(LibraryDisplayType.grid) Label("Detailed", systemImage: LibraryDisplayType.list.systemImage) diff --git a/Swiftfin/Views/EditServerView.swift b/Swiftfin/Views/EditServerView.swift index b6d35120e..d9f5416c0 100644 --- a/Swiftfin/Views/EditServerView.swift +++ b/Swiftfin/Views/EditServerView.swift @@ -55,7 +55,7 @@ struct EditServerView: View { } if isEditing { - ListRowButton("Delete") { + ListRowButton(L10n.delete) { isPresentingConfirmDeletion = true } .foregroundStyle(.red, .red.opacity(0.2)) @@ -66,8 +66,8 @@ struct EditServerView: View { .onChange(of: currentServerURL) { newValue in viewModel.setCurrentURL(to: newValue) } - .alert("Delete Server", isPresented: $isPresentingConfirmDeletion) { - Button("Delete", role: .destructive) { + .alert(L10n.deleteServer, isPresented: $isPresentingConfirmDeletion) { + Button(L10n.delete, role: .destructive) { viewModel.delete() router.popLast() } diff --git a/Swiftfin/Views/PagingLibraryView/Components/LibraryViewTypeToggle.swift b/Swiftfin/Views/PagingLibraryView/Components/LibraryViewTypeToggle.swift index d3ca3efd2..18e63e6e6 100644 --- a/Swiftfin/Views/PagingLibraryView/Components/LibraryViewTypeToggle.swift +++ b/Swiftfin/Views/PagingLibraryView/Components/LibraryViewTypeToggle.swift @@ -59,7 +59,7 @@ extension PagingLibraryView { } } - Section("Layout") { + Section(L10n.layout) { Button { viewType = .grid } label: { @@ -87,9 +87,9 @@ extension PagingLibraryView { } label: { switch viewType { case .grid: - Label("Layout", systemImage: "square.grid.2x2.fill") + Label(L10n.layout, systemImage: "square.grid.2x2.fill") case .list: - Label("Layout", systemImage: "square.fill.text.grid.1x2") + Label(L10n.layout, systemImage: "square.fill.text.grid.1x2") } } } diff --git a/Swiftfin/Views/SelectUserView/Components/AddUserButton.swift b/Swiftfin/Views/SelectUserView/Components/AddUserButton.swift index 4b345bed5..a0145a481 100644 --- a/Swiftfin/Views/SelectUserView/Components/AddUserButton.swift +++ b/Swiftfin/Views/SelectUserView/Components/AddUserButton.swift @@ -63,13 +63,13 @@ extension SelectUserView { .clipShape(.circle) .aspectRatio(1, contentMode: .fill) - Text("Add User") + Text(L10n.addUser) .font(.title3) .fontWeight(.semibold) .foregroundStyle(isEnabled ? .primary : .secondary) if serverSelection == .all { - Text("Hidden") + Text(L10n.hidden) .font(.footnote) .hidden() } diff --git a/Swiftfin/Views/SelectUserView/Components/AddUserRow.swift b/Swiftfin/Views/SelectUserView/Components/AddUserRow.swift index 89da093a9..336d20993 100644 --- a/Swiftfin/Views/SelectUserView/Components/AddUserRow.swift +++ b/Swiftfin/Views/SelectUserView/Components/AddUserRow.swift @@ -48,7 +48,7 @@ extension SelectUserView { private var rowContent: some View { HStack { - Text("Add User") + Text(L10n.addUser) .font(.title3) .fontWeight(.semibold) .foregroundStyle(isEnabled ? .primary : .secondary) diff --git a/Swiftfin/Views/SelectUserView/Components/ServerSelectionMenu.swift b/Swiftfin/Views/SelectUserView/Components/ServerSelectionMenu.swift index a14f754b7..ee370848e 100644 --- a/Swiftfin/Views/SelectUserView/Components/ServerSelectionMenu.swift +++ b/Swiftfin/Views/SelectUserView/Components/ServerSelectionMenu.swift @@ -45,21 +45,21 @@ extension SelectUserView { var body: some View { Menu { Section { - Button("Add Server", systemImage: "plus") { + Button(L10n.addServer, systemImage: "plus") { router.route(to: \.connectToServer) } if let selectedServer { - Button("Edit Server", systemImage: "server.rack") { + Button(L10n.editServer, systemImage: "server.rack") { router.route(to: \.editServer, selectedServer) } } } - Picker("Servers", selection: _serverSelection) { + Picker(L10n.servers, selection: _serverSelection) { if viewModel.servers.keys.count > 1 { - Label("All Servers", systemImage: "person.2.fill") + Label(L10n.allServers, systemImage: "person.2.fill") .tag(SelectUserServerSelection.all) } @@ -83,7 +83,7 @@ extension SelectUserView { HStack { switch serverSelection { case .all: - Label("All Servers", systemImage: "person.2.fill") + Label(L10n.allServers, systemImage: "person.2.fill") case let .server(id): if let server = viewModel.servers.keys.first(where: { $0.id == id }) { Label(server.name, systemImage: "server.rack") diff --git a/Swiftfin/Views/SelectUserView/Components/UserGridButton.swift b/Swiftfin/Views/SelectUserView/Components/UserGridButton.swift index 1c0761b52..311025c09 100644 --- a/Swiftfin/Views/SelectUserView/Components/UserGridButton.swift +++ b/Swiftfin/Views/SelectUserView/Components/UserGridButton.swift @@ -126,7 +126,7 @@ extension SelectUserView { } .buttonStyle(.plain) .contextMenu { - Button("Delete", role: .destructive) { + Button(L10n.delete, role: .destructive) { onDelete() } } diff --git a/Swiftfin/Views/SelectUserView/Components/UserRow.swift b/Swiftfin/Views/SelectUserView/Components/UserRow.swift index 75c696fc3..b8246c6bf 100644 --- a/Swiftfin/Views/SelectUserView/Components/UserRow.swift +++ b/Swiftfin/Views/SelectUserView/Components/UserRow.swift @@ -131,7 +131,7 @@ extension SelectUserView { } .onSelect(perform: action) .contextMenu { - Button("Delete", role: .destructive) { + Button(L10n.delete, role: .destructive) { onDelete() } } diff --git a/Swiftfin/Views/SettingsView/CustomDeviceProfileSettingsView/Components/CustomProfileButton.swift b/Swiftfin/Views/SettingsView/CustomDeviceProfileSettingsView/Components/CustomProfileButton.swift index f6fc5b672..7e1d630bc 100644 --- a/Swiftfin/Views/SettingsView/CustomDeviceProfileSettingsView/Components/CustomProfileButton.swift +++ b/Swiftfin/Views/SettingsView/CustomDeviceProfileSettingsView/Components/CustomProfileButton.swift @@ -50,7 +50,7 @@ extension CustomDeviceProfileSettingsView { profileDetailsView( title: L10n.useAsTranscodingProfile, - detail: profile.useAsTranscodingProfile ? "Yes" : "No" + detail: profile.useAsTranscodingProfile ? L10n.yes : L10n.no ) } diff --git a/Swiftfin/Views/SettingsView/CustomDeviceProfileSettingsView/Components/EditCustomDeviceProfileView.swift b/Swiftfin/Views/SettingsView/CustomDeviceProfileSettingsView/Components/EditCustomDeviceProfileView.swift index 0a9a3bc50..474992ba4 100644 --- a/Swiftfin/Views/SettingsView/CustomDeviceProfileSettingsView/Components/EditCustomDeviceProfileView.swift +++ b/Swiftfin/Views/SettingsView/CustomDeviceProfileSettingsView/Components/EditCustomDeviceProfileView.swift @@ -123,7 +123,7 @@ extension CustomDeviceProfileSettingsView { } .navigationTitle(L10n.customProfile) .topBarTrailing { - Button("Save") { + Button(L10n.save) { if createProfile { customDeviceProfiles.append(profile) } else { @@ -137,7 +137,7 @@ extension CustomDeviceProfileSettingsView { .disabled(!isValid) } .alert("Profile not saved", isPresented: $isPresentingNotSaved) { - Button("Close", role: .destructive) { + Button(L10n.close, role: .destructive) { router.dismissCoordinator() } } diff --git a/Swiftfin/Views/SettingsView/GestureSettingsView.swift b/Swiftfin/Views/SettingsView/GestureSettingsView.swift index c062ef818..2c6a41aa8 100644 --- a/Swiftfin/Views/SettingsView/GestureSettingsView.swift +++ b/Swiftfin/Views/SettingsView/GestureSettingsView.swift @@ -57,6 +57,6 @@ struct GestureSettingsView: View { CaseIterablePicker("Right Vertical Pan", selection: $verticalPanGestureRight) } } - .navigationTitle("Gestures") + .navigationTitle(L10n.gestures) } } diff --git a/Swiftfin/Views/SettingsView/NativeVideoPlayerSettingsView.swift b/Swiftfin/Views/SettingsView/NativeVideoPlayerSettingsView.swift index 0f64516c2..a6458bc93 100644 --- a/Swiftfin/Views/SettingsView/NativeVideoPlayerSettingsView.swift +++ b/Swiftfin/Views/SettingsView/NativeVideoPlayerSettingsView.swift @@ -20,7 +20,7 @@ struct NativeVideoPlayerSettingsView: View { Section { BasicStepper( - title: "Resume Offset", + title: L10n.resumeOffset, value: $resumeOffset, range: 0 ... 30, step: 1 @@ -29,9 +29,9 @@ struct NativeVideoPlayerSettingsView: View { $0.secondLabel } } footer: { - Text("Resume content seconds before the recorded resume time") + Text(L10n.resumeOffsetDescription) } } - .navigationTitle("Native Player") + .navigationTitle(L10n.nativePlayer) } } diff --git a/Swiftfin/Views/SettingsView/UserProfileSettingsView/UserProfileSettingsView.swift b/Swiftfin/Views/SettingsView/UserProfileSettingsView/UserProfileSettingsView.swift index afebdcd6b..038b6c83d 100644 --- a/Swiftfin/Views/SettingsView/UserProfileSettingsView/UserProfileSettingsView.swift +++ b/Swiftfin/Views/SettingsView/UserProfileSettingsView/UserProfileSettingsView.swift @@ -89,14 +89,14 @@ struct UserProfileSettingsView: View { router.route(to: \.quickConnect) } - ChevronButton("Password") + ChevronButton(L10n.password) .onSelect { router.route(to: \.resetUserPassword, viewModel.userSession.user.id) } } Section { - ChevronButton("Security") + ChevronButton(L10n.security) .onSelect { router.route(to: \.localSecurity) } @@ -114,7 +114,7 @@ struct UserProfileSettingsView: View { } } .alert("Reset Settings", isPresented: $isPresentingConfirmReset) { - Button("Reset", role: .destructive) { + Button(L10n.reset, role: .destructive) { do { try viewModel.userSession.user.deleteSettings() } catch { @@ -134,7 +134,7 @@ struct UserProfileSettingsView: View { router.route(to: \.photoPicker, viewModel) } - Button("Delete", role: .destructive) { + Button(L10n.delete, role: .destructive) { viewModel.deleteCurrentUserProfileImage() } } diff --git a/Swiftfin/Views/SettingsView/VideoPlayerSettingsView/Components/Sections/SubtitleSection.swift b/Swiftfin/Views/SettingsView/VideoPlayerSettingsView/Components/Sections/SubtitleSection.swift index 146439874..3a4f4d589 100644 --- a/Swiftfin/Views/SettingsView/VideoPlayerSettingsView/Components/Sections/SubtitleSection.swift +++ b/Swiftfin/Views/SettingsView/VideoPlayerSettingsView/Components/Sections/SubtitleSection.swift @@ -42,7 +42,7 @@ extension VideoPlayerSettingsView { Text(L10n.subtitle) } footer: { // TODO: better wording - Text("Settings only affect some subtitle types") + Text(L10n.subtitlesDisclaimer) } } } diff --git a/Swiftfin/Views/UserSignInView/Components/UserSignInSecurityView.swift b/Swiftfin/Views/UserSignInView/Components/UserSignInSecurityView.swift index df1c7fd5e..bb680fdb1 100644 --- a/Swiftfin/Views/UserSignInView/Components/UserSignInSecurityView.swift +++ b/Swiftfin/Views/UserSignInView/Components/UserSignInSecurityView.swift @@ -43,7 +43,7 @@ extension UserSignInView { List { Section { - CaseIterablePicker("Security", selection: $updateSignInPolicy) + CaseIterablePicker(L10n.security, selection: $updateSignInPolicy) } footer: { // TODO: descriptions of each section @@ -59,7 +59,7 @@ extension UserSignInView { Text(UserAccessPolicy.requireDeviceAuthentication.displayTitle) .fontWeight(.semibold) - Text("Require device authentication when signing in to the user.") + Text(L10n.requireDeviceAuthDescription) } .padding(.bottom, 15) @@ -67,7 +67,7 @@ extension UserSignInView { Text(UserAccessPolicy.requirePin.displayTitle) .fontWeight(.semibold) - Text("Require a local pin when signing in to the user. This pin is unrecoverable.") + Text(L10n.requirePinDescription) } .padding(.bottom, 15) @@ -75,7 +75,7 @@ extension UserSignInView { Text(UserAccessPolicy.none.displayTitle) .fontWeight(.semibold) - Text("Save the user to this device without any local authentication.") + Text(L10n.saveUserWithoutAuthDescription) } } .frame(width: max(10, listSize.width - 50)) @@ -84,16 +84,16 @@ extension UserSignInView { if accessPolicy == .requirePin { Section { - TextField("Hint", text: $updatePinHint) + TextField(L10n.hint, text: $updatePinHint) } header: { - Text("Hint") + Text(L10n.hint) } footer: { - Text("Set a hint when prompting for the pin.") + Text(L10n.setPinHintDescription) } } } .animation(.linear, value: accessPolicy) - .navigationTitle("Security") + .navigationTitle(L10n.security) .navigationBarTitleDisplayMode(.inline) .navigationBarCloseButton { router.popLast()