Add english localization file

This commit is contained in:
Aiden Vigue 2021-07-16 20:06:37 -04:00
parent 11671d9c42
commit 1dbb0b8924
No known key found for this signature in database
GPG Key ID: B9A09843AB079D5B
17 changed files with 87 additions and 69 deletions

View File

@ -20,7 +20,7 @@ struct ConnectToServerView: View {
if viewModel.publicUsers.isEmpty {
Section(header: Text(viewModel.lastPublicUsers.isEmpty || username == "" ? "Login to \(ServerEnvironment.current.server.name ?? "")": "")) {
if viewModel.lastPublicUsers.isEmpty || username == "" {
TextField("Username", text: $username)
TextField(NSLocalizedString("Username", comment: ""), text: $username)
.disableAutocorrection(true)
.autocapitalization(.none)
} else {
@ -33,7 +33,7 @@ struct ConnectToServerView: View {
}
}
SecureField("Password (optional)", text: $password)
SecureField(NSLocalizedString("Password", comment: ""), text: $password)
.disableAutocorrection(true)
.autocapitalization(.none)
}
@ -108,7 +108,7 @@ struct ConnectToServerView: View {
Form {
Section(header: Text("Server Information")) {
TextField("Jellyfin Server URL", text: $uri)
TextField(NSLocalizedString("Server URL", comment: ""), text: $uri)
.disableAutocorrection(true)
.autocapitalization(.none)
Button {
@ -170,6 +170,6 @@ struct ConnectToServerView: View {
.onChange(of: password) { password in
viewModel.passwordSubject.send(password)
}
.navigationTitle(viewModel.isConnectedServer ? "Who's watching?" : "Connect to Jellyfin")
.navigationTitle(viewModel.isConnectedServer ? NSLocalizedString("Who's watching?", comment: "") : NSLocalizedString("Connect to Jellyfin", comment: ""))
}
}

View File

@ -42,14 +42,14 @@ struct MainTabView: View {
HomeView()
.offset(y: -1) // don't remove this. it breaks tabview on 4K displays.
.tabItem {
Text(Tab.home.localized)
Text("All Media")
Image(systemName: "house")
}
.tag(Tab.home)
Text("Library")
.tabItem {
Text(Tab.allMedia.localized)
Text("Home")
Image(systemName: "folder")
}
.tag(Tab.allMedia)
@ -62,15 +62,6 @@ extension MainTabView {
enum Tab: String {
case home
case allMedia
var localized: String {
switch self {
case .home:
return "Home"
case .allMedia:
return "All Media"
}
}
}
}

View File

@ -14,7 +14,7 @@ class AudioViewController: InfoTabViewController {
override func viewDidLoad() {
super.viewDidLoad()
tabBarItem.title = "Audio"
tabBarItem.title = NSLocalizedString("Audio", comment: "")
}

View File

@ -16,7 +16,7 @@ class MediaInfoViewController: InfoTabViewController {
override func viewDidLoad() {
super.viewDidLoad()
tabBarItem.title = "Info"
tabBarItem.title = NSLocalizedString("Info", comment: "")
}
func setMedia(item: BaseItemDto) {

View File

@ -14,7 +14,7 @@ class SubtitlesViewController: InfoTabViewController {
override func viewDidLoad() {
super.viewDidLoad()
tabBarItem.title = "Subtitles"
tabBarItem.title = NSLocalizedString("Subtitles", comment: "")
}

View File

@ -106,6 +106,9 @@
53ABFDEE26799DCD00886593 /* ImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 531AC8BE26750DE20091C7EB /* ImageView.swift */; };
53AD124D267029D60094A276 /* SeriesItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53987CA526572F0700E7EA70 /* SeriesItemView.swift */; };
53AD124E26702B8A0094A276 /* SeasonItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53987CA326572C1300E7EA70 /* SeasonItemView.swift */; };
53AFFDE926A2520800261FD0 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 53AFFDE726A2520800261FD0 /* Localizable.strings */; };
53AFFDEA26A2520800261FD0 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 53AFFDE726A2520800261FD0 /* Localizable.strings */; };
53AFFDEB26A2520800261FD0 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 53AFFDE726A2520800261FD0 /* Localizable.strings */; };
53CD2A40268A49C2002ABD4E /* ItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53CD2A3F268A49C2002ABD4E /* ItemView.swift */; };
53CD2A42268A4B38002ABD4E /* MovieItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53CD2A41268A4B38002ABD4E /* MovieItemView.swift */; };
53DE4BD02670961400739748 /* EpisodeItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53987CA72657424A00E7EA70 /* EpisodeItemView.swift */; };
@ -305,6 +308,8 @@
53ABFDDD267974E300886593 /* SplashView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashView.swift; sourceTree = "<group>"; };
53ABFDEA2679753200886593 /* ConnectToServerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectToServerView.swift; sourceTree = "<group>"; };
53AD124C2670278D0094A276 /* JellyfinPlayer.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = JellyfinPlayer.entitlements; sourceTree = "<group>"; };
53AFFDE826A2520800261FD0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Localizable.strings; sourceTree = "<group>"; };
53AFFDEC26A2523300261FD0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = ../es.lproj/Localizable.strings; sourceTree = "<group>"; };
53CD2A3F268A49C2002ABD4E /* ItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemView.swift; sourceTree = "<group>"; };
53CD2A41268A4B38002ABD4E /* MovieItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieItemView.swift; sourceTree = "<group>"; };
53D5E3DC264B47EE00BADDC8 /* MobileVLCKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MobileVLCKit.xcframework; path = Carthage/Build/MobileVLCKit.xcframework; sourceTree = "<group>"; };
@ -535,6 +540,7 @@
5377CBE8263B596A003A4E83 = {
isa = PBXGroup;
children = (
53AFFDE626A2520800261FD0 /* en.lproj */,
53D5E3DB264B47EE00BADDC8 /* Frameworks */,
5377CBF3263B596A003A4E83 /* JellyfinPlayer */,
535870612669D21600D05A09 /* JellyfinPlayer tvOS */,
@ -601,6 +607,14 @@
path = "Preview Content";
sourceTree = "<group>";
};
53AFFDE626A2520800261FD0 /* en.lproj */ = {
isa = PBXGroup;
children = (
53AFFDE726A2520800261FD0 /* Localizable.strings */,
);
path = en.lproj;
sourceTree = SOURCE_ROOT;
};
53D5E3DB264B47EE00BADDC8 /* Frameworks */ = {
isa = PBXGroup;
children = (
@ -824,7 +838,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
es,
);
mainGroup = 5377CBE8263B596A003A4E83;
packageReferences = (
@ -856,6 +870,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
53AFFDEA26A2520800261FD0 /* Localizable.strings in Resources */,
5310695D2684E7EE00CFFDBA /* VideoPlayer.storyboard in Resources */,
5358706A2669D21700D05A09 /* Preview Assets.xcassets in Resources */,
535870672669D21700D05A09 /* Assets.xcassets in Resources */,
@ -867,6 +882,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
53AFFDE926A2520800261FD0 /* Localizable.strings in Resources */,
5377CBFC263B596B003A4E83 /* Preview Assets.xcassets in Resources */,
53313B90265EEA6D00947AA3 /* VideoPlayer.storyboard in Resources */,
AE8C3159265D6F90008AA076 /* bitrates.json in Resources */,
@ -879,6 +895,7 @@
buildActionMask = 2147483647;
files = (
628B95292670CABE0091AF3B /* Assets.xcassets in Resources */,
53AFFDEB26A2520800261FD0 /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1151,6 +1168,18 @@
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
53AFFDE726A2520800261FD0 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
53AFFDE826A2520800261FD0 /* en */,
53AFFDEC26A2523300261FD0 /* es */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
535870722669D21700D05A09 /* Debug */ = {
isa = XCBuildConfiguration;
@ -1161,7 +1190,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_ASSET_PATHS = "\"JellyfinPlayer tvOS/Preview Content\"";
DEVELOPMENT_TEAM = 9R8RREG67J;
ENABLE_PREVIEWS = YES;
@ -1176,9 +1205,10 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 14.5;
TVOS_DEPLOYMENT_TARGET = 14.1;
};
name = Debug;
};
@ -1191,7 +1221,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_ASSET_PATHS = "\"JellyfinPlayer tvOS/Preview Content\"";
DEVELOPMENT_TEAM = 9R8RREG67J;
ENABLE_PREVIEWS = YES;
@ -1205,9 +1235,10 @@
PRODUCT_BUNDLE_IDENTIFIER = me.vigue.jellyfin;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 14.5;
TVOS_DEPLOYMENT_TARGET = 14.1;
};
name = Release;
};
@ -1215,6 +1246,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@ -1278,6 +1310,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@ -1340,7 +1373,7 @@
CODE_SIGN_ENTITLEMENTS = JellyfinPlayer/JellyfinPlayer.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 9R8RREG67J;
ENABLE_BITCODE = NO;
@ -1360,6 +1393,7 @@
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
@ -1375,7 +1409,7 @@
CODE_SIGN_ENTITLEMENTS = JellyfinPlayer/JellyfinPlayer.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 9R8RREG67J;
@ -1395,6 +1429,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
@ -1407,7 +1442,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = 9R8RREG67J;
INFOPLIST_FILE = WidgetExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
@ -1421,6 +1456,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
@ -1433,7 +1469,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = 9R8RREG67J;
INFOPLIST_FILE = WidgetExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
@ -1446,6 +1482,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.vigue.jellyfin.widget;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};

View File

@ -18,7 +18,8 @@ struct PortraitItemView: View {
ImageView(src: item.type != "Episode" ? item.getPrimaryImage(maxWidth: 100) : item.getSeriesPrimaryImage(maxWidth: 100), bh: item.type != "Episode" ? item.getPrimaryImageBlurHash() : item.getSeriesPrimaryImageBlurHash())
.frame(width: 100, height: 150)
.cornerRadius(10)
.shadow(radius: 4)
.shadow(radius: 4, y: 2)
.shadow(radius: 4, y: 2)
.overlay(
Rectangle()
.fill(Color(red: 172/255, green: 92/255, blue: 195/255))
@ -43,20 +44,23 @@ struct PortraitItemView: View {
.overlay(
ZStack {
if item.userData?.played ?? false {
Image(systemName: "circle.fill")
.foregroundColor(.white)
Image(systemName: "checkmark.circle.fill")
.foregroundColor(Color(.systemBlue))
.foregroundColor(.accentColor)
.background(Color(.white))
.cornerRadius(.infinity)
} else {
if item.userData?.unplayedItemCount != nil {
Image(systemName: "circle.fill")
.foregroundColor(Color(.systemBlue))
Capsule()
.fill(Color.accentColor)
.frame(minWidth: 20, minHeight: 20, maxHeight: 20)
Text(String(item.userData!.unplayedItemCount ?? 0))
.foregroundColor(.white)
.font(.caption2)
.padding(2)
}
}
}.padding(2)
.fixedSize()
.opacity(1), alignment: .topTrailing).opacity(1)
Text(item.seriesName ?? item.name ?? "")
.font(.caption)

View File

@ -19,10 +19,10 @@ struct ConnectToServerView: View {
if viewModel.isConnectedServer {
if viewModel.publicUsers.isEmpty {
Section(header: Text("Login to \(ServerEnvironment.current.server.name ?? "")")) {
TextField("Username", text: $username)
TextField(NSLocalizedString("Username", comment: ""), text: $username)
.disableAutocorrection(true)
.autocapitalization(.none)
SecureField("Password", text: $password)
SecureField(NSLocalizedString("Password", comment: ""), text: $password)
.disableAutocorrection(true)
.autocapitalization(.none)
Button {
@ -106,7 +106,7 @@ struct ConnectToServerView: View {
}
} else {
Section(header: Text("Connect Manually")) {
TextField("Server URL", text: $uri)
TextField(NSLocalizedString("Server URL", comment: ""), text: $uri)
.disableAutocorrection(true)
.autocapitalization(.none)
Button {
@ -162,6 +162,6 @@ struct ConnectToServerView: View {
.alert(item: $viewModel.errorMessage) { _ in
Alert(title: Text("Error"), message: Text($viewModel.errorMessage.wrappedValue!), dismissButton: .default(Text("Try again")))
}
.navigationTitle("Connect to Server")
.navigationTitle(NSLocalizedString("Connect to Server", comment: ""))
}
}

View File

@ -42,7 +42,8 @@ struct ContinueWatchingView: View {
ImageView(src: item.getBackdropImage(maxWidth: 320), bh: item.getBackdropImageBlurHash())
.frame(width: 320, height: 180)
.cornerRadius(10)
.shadow(radius: 4)
.shadow(radius: 4, y: 2)
.shadow(radius: 4, y: 2)
.overlay(
Rectangle()
.fill(Color(red: 172/255, green: 92/255, blue: 195/255))

View File

@ -56,7 +56,7 @@ struct HomeView: View {
var body: some View {
innerBody
.navigationTitle(MainTabView.Tab.home.localized)
.navigationTitle(NSLocalizedString("Home", comment: ""))
.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
Button {

View File

@ -29,19 +29,19 @@ struct LibraryFilterView: View {
} else {
Form {
if viewModel.enabledFilterType.contains(.genre) {
MultiSelector(label: "Genres",
MultiSelector(label: NSLocalizedString("Genres", comment: ""),
options: viewModel.possibleGenres,
optionToString: { $0.name ?? "" },
selected: $viewModel.modifiedFilters.withGenres)
}
if viewModel.enabledFilterType.contains(.filter) {
MultiSelector(label: "Filters",
MultiSelector(label: NSLocalizedString("Filters", comment: ""),
options: viewModel.possibleItemFilters,
optionToString: { $0.localized },
selected: $viewModel.modifiedFilters.filters)
}
if viewModel.enabledFilterType.contains(.tag) {
MultiSelector(label: "Tags",
MultiSelector(label: NSLocalizedString("Tags", comment: ""),
options: viewModel.possibleTags,
optionToString: { $0 },
selected: $viewModel.modifiedFilters.tags)
@ -70,7 +70,7 @@ struct LibraryFilterView: View {
}
}
}
.navigationBarTitle("Filter Results", displayMode: .inline)
.navigationBarTitle(NSLocalizedString("Filter Results", comment: ""), displayMode: .inline)
.toolbar {
ToolbarItemGroup(placement: .navigationBarLeading) {
Button {

View File

@ -93,7 +93,7 @@ struct LibraryListView: View {
.padding(.trailing, 16)
.padding(.top, 8)
}
.navigationTitle("All Media")
.navigationTitle(NSLocalizedString("All Media", comment: ""))
.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
NavigationLink(destination: LazyView {

View File

@ -20,7 +20,7 @@ struct MainTabView: View {
}
.navigationViewStyle(StackNavigationViewStyle())
.tabItem {
Text(Tab.home.localized)
Text("Home")
Image(systemName: "house")
}
.tag(Tab.home)
@ -29,7 +29,7 @@ struct MainTabView: View {
}
.navigationViewStyle(StackNavigationViewStyle())
.tabItem {
Text(Tab.allMedia.localized)
Text("All Media")
Image(systemName: "folder")
}
.tag(Tab.allMedia)
@ -42,14 +42,5 @@ extension MainTabView {
enum Tab: String {
case home
case allMedia
var localized: String {
switch self {
case .home:
return "Home"
case .allMedia:
return "All Media"
}
}
}
}

View File

@ -16,7 +16,7 @@ struct SearchBar: View {
var body: some View {
HStack(spacing: 8) {
TextField("Search...", text: $text)
TextField(NSLocalizedString("Search...", comment: ""), text: $text)
.padding(8)
.padding(.horizontal, 16)
.background(Color(.systemGray6))

View File

@ -70,10 +70,8 @@ struct SettingsView: View {
Button {
let nc = NotificationCenter.default
nc.post(name: Notification.Name("didSignOut"), object: nil)
SessionManager.current.logout()
} label: {
Text("Log out").font(.callout)
Text("Switch user").font(.callout)
}
}
}

View File

@ -73,7 +73,7 @@ struct VideoPlayerCastDeviceSelector: View {
}
}
.navigationBarTitleDisplayMode(.inline)
.navigationTitle("Select Cast Destination")
.navigationTitle(NSLocalizedString("Select Cast Destination", comment: ""))
.toolbar {
ToolbarItemGroup(placement: .navigationBarLeading) {
if UIDevice.current.userInterfaceIdiom == .phone {

View File

@ -46,7 +46,7 @@ struct VideoPlayerSettings: View {
var body: some View {
NavigationView {
Form {
Picker("Closed Captions", selection: $captionTrack) {
Picker(NSLocalizedString("Closed Captions", comment: ""), selection: $captionTrack) {
ForEach(delegate.subtitleTrackArray, id: \.id) { caption in
Text(caption.name).tag(caption.id)
}
@ -54,28 +54,24 @@ struct VideoPlayerSettings: View {
.onChange(of: captionTrack) { track in
self.delegate.subtitleTrackChanged(newTrackID: track)
}
Picker("Audio Track", selection: $audioTrack) {
Picker(NSLocalizedString("Audio Track", comment: ""), selection: $audioTrack) {
ForEach(delegate.audioTrackArray, id: \.id) { caption in
Text(caption.name).tag(caption.id).lineLimit(1)
}
}.onChange(of: audioTrack) { track in
self.delegate.audioTrackChanged(newTrackID: track)
}
Picker("Playback Speed", selection: $playbackSpeedSelection) {
Picker(NSLocalizedString("Playback Speed", comment: ""), selection: $playbackSpeedSelection) {
ForEach(delegate.playbackSpeeds.indices, id: \.self) { speedIndex in
let speed = delegate.playbackSpeeds[speedIndex]
if floor(speed) == speed {
Text(String(format: "%.0fx", speed)).tag(speedIndex)
} else {
Text(String(format: "%.2fx", speed)).tag(speedIndex)
}
Text("\(String(speed))x").tag(speedIndex)
}
}
.onChange(of: playbackSpeedSelection, perform: { index in
self.delegate.playbackSpeedChanged(index: index)
})
}.navigationBarTitleDisplayMode(.inline)
.navigationTitle("Audio & Captions")
.navigationTitle(NSLocalizedString("Audio & Captions", comment: ""))
.toolbar {
ToolbarItemGroup(placement: .navigationBarLeading) {
if UIDevice.current.userInterfaceIdiom == .phone {