- BookmarkDetail: All user-facing texts and error messages in BookmarkDetailView, BookmarkDetailViewModel, BookmarkLabelsView, and BookmarkLabelsViewModel translated to English. - Bookmarks: All UI strings, swipe actions, and error messages in BookmarkCardView, BookmarksView, BookmarksViewModel, and related enums translated to English. - Labels: All UI and error messages in LabelsView and LabelsViewModel translated to English. - Menu: All sidebar/tab names, navigation titles, and queue texts in BookmarkState, PhoneTabView, PlayerQueueResumeButton, SidebarTab updated to English. - Settings: All section headers, toggle labels, button texts, and error/success messages in FontSettingsView, FontSettingsViewModel, SettingsContainerView, SettingsGeneralView, SettingsGeneralViewModel, SettingsServerView, SettingsServerViewModel translated to English. - SpeechPlayer: All player UI texts, progress, and queue messages in SpeechPlayerView translated to English. This commit unifies the app language to English for all user-facing areas.
40 lines
1.3 KiB
Swift
40 lines
1.3 KiB
Swift
import SwiftUI
|
|
|
|
struct LabelsView: View {
|
|
@State var viewModel = LabelsViewModel()
|
|
@State private var selectedTag: String? = nil
|
|
@State private var selectedBookmark: Bookmark? = nil
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading) {
|
|
if viewModel.isLoading {
|
|
ProgressView()
|
|
} else if let errorMessage = viewModel.errorMessage {
|
|
Text("Error: \(errorMessage)")
|
|
.foregroundColor(.red)
|
|
} else {
|
|
List {
|
|
ForEach(viewModel.labels, id: \.href) { label in
|
|
NavigationLink {
|
|
BookmarksView(state: .all, type: [], selectedBookmark: .constant(nil), tag: label.name)
|
|
.navigationTitle("\(label.name) (\(label.count))")
|
|
} label: {
|
|
HStack {
|
|
Text(label.name)
|
|
Spacer()
|
|
Text("\(label.count)")
|
|
.foregroundColor(.secondary)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.onAppear {
|
|
Task {
|
|
await viewModel.loadLabels()
|
|
}
|
|
}
|
|
}
|
|
}
|