From dcf40c1daa8e1a39d62256e63f128c0e4f33e5b7 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 25 Jan 2023 13:09:19 -0800 Subject: [PATCH] apply generic local text values --- .../AppExtensions/Share/Views/ShareExtensionView.swift | 6 +++--- apple/OmnivoreKit/Sources/App/MacMenuCommands.swift | 4 ++-- .../OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift | 3 ++- .../Sources/App/PrimaryContentCategory.swift | 2 +- .../OmnivoreKit/Sources/App/Views/DebugMenuView.swift | 2 +- .../App/Views/Highlights/HighlightsListViewModel.swift | 2 +- .../Sources/App/Views/Home/HomeFeedViewIOS.swift | 4 ++-- .../Sources/App/Views/Home/HomeFeedViewMac.swift | 2 +- .../Sources/App/Views/Home/LibrarySearchView.swift | 2 +- .../Sources/App/Views/Labels/ApplyLabelsView.swift | 4 ++-- .../Sources/App/Views/Labels/LabelsView.swift | 2 +- .../Sources/App/Views/LinkItemDetailView.swift | 2 +- .../Sources/App/Views/LinkedItemMetadataEditView.swift | 10 +++++----- .../Sources/App/Views/Profile/ProfileView.swift | 4 ++-- .../App/Views/Profile/RecommendationGroupView.swift | 4 ++-- .../App/Views/Profile/RecommendationGroupsView.swift | 6 +++--- .../Sources/App/Views/Profile/Subscriptions.swift | 2 +- .../App/Views/Registration/CreateProfileView.swift | 4 ++-- .../Registration/EmailAuth/EmailLoginFormView.swift | 8 ++++---- .../Registration/EmailAuth/EmailSignupFormView.swift | 6 +++--- .../App/Views/Registration/NewAppleSignupView.swift | 2 +- .../Sources/App/Views/SelfHostSettingsView.swift | 6 +++--- .../Sources/App/Views/WebReader/RecommendToView.swift | 6 +++--- .../App/Views/WebReader/WebReaderContainer.swift | 8 ++++---- apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift | 6 +++--- .../Views/Article/HighlightAnnotationSheet.swift | 4 ++-- .../Sources/Views/Article/OmnivoreWebView.swift | 4 ++-- .../Sources/Views/FontSizeAdjustmentPopoverView.swift | 2 +- .../Views/Resources/en.lproj/Localizable.strings | 2 +- 29 files changed, 60 insertions(+), 59 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift index f56056fec..1dc41ba03 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift @@ -224,7 +224,7 @@ public struct ShareExtensionView: View { .padding(.trailing, 8) VStack { - Text("Highlight") + Text(LocalText.genericHighlight) .font(.appSubheadline) .foregroundColor(Color.appGrayTextContrast) .frame(maxWidth: .infinity, alignment: .leading) @@ -355,7 +355,7 @@ public struct ShareExtensionView: View { case .editingLabels: return LocalText.labelsGeneric case .viewingHighlight: - return "Highlight" + return LocalText.genericHighlight default: return "" } @@ -479,7 +479,7 @@ public struct ShareExtensionView: View { } .alert("Before saving an article select text in Safari to create a highlight on save.", isPresented: $showHighlightInstructionAlert) { - Button("Ok", role: .cancel) { showHighlightInstructionAlert = false } + Button(LocalText.genericOk, role: .cancel) { showHighlightInstructionAlert = false } } .task { await labelsViewModel.loadLabelsFromStore(dataService: viewModel.services.dataService) diff --git a/apple/OmnivoreKit/Sources/App/MacMenuCommands.swift b/apple/OmnivoreKit/Sources/App/MacMenuCommands.swift index b136aa554..71426eb71 100644 --- a/apple/OmnivoreKit/Sources/App/MacMenuCommands.swift +++ b/apple/OmnivoreKit/Sources/App/MacMenuCommands.swift @@ -104,7 +104,7 @@ import Views Divider() - Picker(selection: $preferredFont, label: Text("Font Family")) { + Picker(selection: $preferredFont, label: Text(LocalText.genericFontFamily)) { ForEach(WebFont.allCases, id: \.self) { font in Text(font.displayValue).tag(font.rawValue) } @@ -112,7 +112,7 @@ import Views Toggle( isOn: $prefersHighContrastText, - label: { Text("High Contrast Text") } + label: { Text(LocalText.genericHighContrastText) } ) } } diff --git a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift index b081212df..d64b600fc 100644 --- a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift +++ b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift @@ -7,6 +7,7 @@ import Utils import PSPDFKit import PSPDFKitUI import Services + import Views struct PDFViewer: View { enum SettingsKeys: String { @@ -134,7 +135,7 @@ import Utils .onShouldShowMenuItemsForSelectedText(perform: { pageView, menuItems, selectedText in let copy = menuItems.first(where: { $0.identifier == "Copy" }) let define = menuItems.first(where: { $0.identifier == "Define" }) - let highlight = MenuItem(title: "Highlight", block: { + let highlight = MenuItem(title: LocalText.genericHighlight, block: { _ = coordinator.highlightSelection( pageView: pageView, selectedText: selectedText, diff --git a/apple/OmnivoreKit/Sources/App/PrimaryContentCategory.swift b/apple/OmnivoreKit/Sources/App/PrimaryContentCategory.swift index 682555142..642a38322 100644 --- a/apple/OmnivoreKit/Sources/App/PrimaryContentCategory.swift +++ b/apple/OmnivoreKit/Sources/App/PrimaryContentCategory.swift @@ -18,7 +18,7 @@ enum PrimaryContentCategory: Identifiable, Hashable, Equatable { case .feed: return "Home" case .profile: - return "Profile" + return LocalText.genericProfile } } diff --git a/apple/OmnivoreKit/Sources/App/Views/DebugMenuView.swift b/apple/OmnivoreKit/Sources/App/Views/DebugMenuView.swift index dfb10939f..6509a09a3 100644 --- a/apple/OmnivoreKit/Sources/App/Views/DebugMenuView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/DebugMenuView.swift @@ -29,7 +29,7 @@ struct DebugMenuView: View { authenticator.logout(dataService: dataService) dataService.switchAppEnvironment(appEnvironment: selectedEnvironment) }, - label: { Text("Apply Changes") } + label: { Text(LocalText.genericChangeApply) } ) .buttonStyle(SolidCapsuleButtonStyle(width: 220)) } diff --git a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListViewModel.swift b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListViewModel.swift index 349cc6c5b..7a251029b 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListViewModel.swift @@ -68,7 +68,7 @@ struct HighlightListItemParams: Identifiable { highlightItems = highlights.map { HighlightListItemParams( highlightID: $0.unwrappedID, - title: "Highlight", + title: LocalText.genericHighlight, annotation: $0.annotation ?? "", quote: $0.quote ?? "", labels: $0.labels.asArray(of: LinkedItemLabel.self), diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index 6c58731dd..69bcd13a0 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -324,7 +324,7 @@ import Views viewModel.itemToSnoozeID = item.id viewModel.snoozePresented = true } label: { - Label { Text("Snooze") } icon: { Image.moon } + Label { Text(LocalText.genericSnooze) } icon: { Image.moon } } } if let author = item.author { @@ -401,7 +401,7 @@ import Views viewModel.itemToSnoozeID = item.id viewModel.snoozePresented = true } label: { - Label { Text("Snooze") } icon: { Image.moon } + Label { Text(LocalText.genericSnooze) } icon: { Image.moon } }.tint(.appYellow48) } } diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift index 5731ddde1..b0e4e91f9 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift @@ -78,7 +78,7 @@ import Views viewModel.itemToSnoozeID = item.id viewModel.snoozePresented = true } label: { - Label { Text("Snooze") } icon: { Image.moon } + Label { Text(LocalText.genericSnooze) } icon: { Image.moon } } } } diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/LibrarySearchView.swift b/apple/OmnivoreKit/Sources/App/Views/Home/LibrarySearchView.swift index b6e06cb44..202f468dc 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/LibrarySearchView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/LibrarySearchView.swift @@ -91,7 +91,7 @@ } listBody .navigationTitle("Search") - .navigationBarItems(trailing: Button(action: { dismiss() }, label: { Text("Close") })) + .navigationBarItems(trailing: Button(action: { dismiss() }, label: { Text(LocalText.genericClose) })) .navigationBarTitleDisplayMode(NavigationBarItem.TitleDisplayMode.inline) .searchable(text: $viewModel.searchTerm, placement: .navigationBarDrawer(displayMode: .always)) { ForEach(viewModel.items) { item in diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift index d3b8adde3..676435c27 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift @@ -21,9 +21,9 @@ struct ApplyLabelsView: View { var confirmButtonText: String { switch self { case .item, .highlight: - return "Save" + return LocalText.genericSave case .list: - return "Done" + return LocalText.doneGeneric } } } diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift index c4dac6a0b..30e7163c3 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift @@ -186,7 +186,7 @@ struct CreateLabelView: View { description: nil ) }, - label: { Text("Create").foregroundColor(.appGrayTextContrast) } + label: { Text(LocalText.genericCreate).foregroundColor(.appGrayTextContrast) } ) .opacity(shouldDisableCreateButton ? 0.2 : 1) .disabled(shouldDisableCreateButton) diff --git a/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift b/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift index 5eeafbe4c..e7f6a4308 100644 --- a/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift @@ -204,7 +204,7 @@ struct LinkItemDetailView: View { } else { HStack(alignment: .center) { Spacer() - Text("Loading...") + Text(LocalText.genericLoading) Spacer() } } diff --git a/apple/OmnivoreKit/Sources/App/Views/LinkedItemMetadataEditView.swift b/apple/OmnivoreKit/Sources/App/Views/LinkedItemMetadataEditView.swift index 4af279429..11cbb47d4 100644 --- a/apple/OmnivoreKit/Sources/App/Views/LinkedItemMetadataEditView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/LinkedItemMetadataEditView.swift @@ -36,7 +36,7 @@ struct LinkedItemMetadataEditView: View { ScrollView(showsIndicators: false) { VStack(alignment: .center, spacing: 16) { VStack(alignment: .leading, spacing: 6) { - Text("Title") + Text(LocalText.genericTitle) .font(.appFootnote) .foregroundColor(.appGrayTextContrast) TextField("", text: $viewModel.title) @@ -44,7 +44,7 @@ struct LinkedItemMetadataEditView: View { } VStack(alignment: .leading, spacing: 6) { - Text("Author") + Text(LocalText.genericAuthor) .font(.appFootnote) .foregroundColor(.appGrayTextContrast) TextField("", text: $viewModel.author) @@ -52,7 +52,7 @@ struct LinkedItemMetadataEditView: View { } VStack(alignment: .leading, spacing: 6) { - Text("Description") + Text(LocalText.genericDescription) .font(.appFootnote) .foregroundColor(.appGrayTextContrast) TextEditor(text: $viewModel.description) @@ -98,7 +98,7 @@ struct LinkedItemMetadataEditView: View { viewModel.submit(dataService: dataService, item: item) presentationMode.wrappedValue.dismiss() }, - label: { Text("Save").foregroundColor(.appGrayTextContrast) } + label: { Text(LocalText.genericSave).foregroundColor(.appGrayTextContrast) } ) } ToolbarItem(placement: .barLeading) { @@ -120,7 +120,7 @@ struct LinkedItemMetadataEditView: View { viewModel.submit(dataService: dataService, item: item) presentationMode.wrappedValue.dismiss() }, - label: { Text("Save").foregroundColor(.appGrayTextContrast) } + label: { Text(LocalText.genericSave).foregroundColor(.appGrayTextContrast) } ) Button( diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift index 9cf579550..5f86e102f 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift @@ -153,7 +153,7 @@ struct ProfileView: View { .alert(isPresented: $showLogoutConfirmation) { Alert( title: Text(LocalText.profileConfirmLogoutMessage), - primaryButton: .destructive(Text("Confirm")) { + primaryButton: .destructive(Text(LocalText.genericConfirm)) { authenticator.logout(dataService: dataService) }, secondaryButton: .cancel() @@ -161,7 +161,7 @@ struct ProfileView: View { } } } - .navigationTitle("Profile") + .navigationTitle(LocalText.genericProfile) } } diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/RecommendationGroupView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/RecommendationGroupView.swift index c076ce392..e1d55f92b 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/RecommendationGroupView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/RecommendationGroupView.swift @@ -165,7 +165,7 @@ struct RecommendationGroupView: View { private var innerBody: some View { Group { - Section("Name") { + Section(LocalText.genericName) { Text(viewModel.recommendationGroup.name) } @@ -195,7 +195,7 @@ struct RecommendationGroupView: View { } .alert(isPresented: $viewModel.showLeaveGroup) { Alert( - title: Text(Localtext.clubsLeaveConfirm), + title: Text(LocalText.clubsLeaveConfirm), primaryButton: .destructive(Text(LocalText.clubsLeave)) { Task { let success = await viewModel.leaveGroup(dataService: dataService) diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/RecommendationGroupsView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/RecommendationGroupsView.swift index 701510ca1..3c75a2fe3 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/RecommendationGroupsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/RecommendationGroupsView.swift @@ -62,7 +62,7 @@ struct CreateRecommendationGroupView: View { await viewModel.createGroup(dataService: dataService, name: self.name) } }, label: { - Text("Next") + Text(LocalText.genericNext) }) .disabled(name.isEmpty) ) @@ -72,7 +72,7 @@ struct CreateRecommendationGroupView: View { var body: some View { NavigationView { Form { - TextField("Name", text: $name, prompt: Text(Localtext.clubsName)) + TextField(LocalText.genericName, text: $name, prompt: Text(LocalText.clubsName)) Section("Club Rules") { Toggle("Only admins can post", isOn: $viewModel.onlyAdminCanPost) @@ -91,7 +91,7 @@ struct CreateRecommendationGroupView: View { .alert(isPresented: $viewModel.showCreateError) { Alert( title: Text(viewModel.createGroupError ?? "Error creating group"), - dismissButton: .cancel(Text("Ok")) { + dismissButton: .cancel(Text(LocalText.genericOk)) { viewModel.createGroupError = nil viewModel.showCreateError = false } diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/Subscriptions.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/Subscriptions.swift index b8f1fcc1e..d9fee2c93 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/Subscriptions.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/Subscriptions.swift @@ -60,7 +60,7 @@ struct SubscriptionsView: View { Text(LocalText.subscriptionsErrorRetrieving).multilineTextAlignment(.center) Button( action: { Task { await viewModel.loadSubscriptions(dataService: dataService) } }, - label: { Text("Retry") } + label: { Text(LocalText.genericRetry) } ) .buttonStyle(RoundedRectButtonStyle()) } diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift index 788cc7b01..d637e0e61 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift @@ -18,7 +18,7 @@ import Views } var submitButtonText: String { - hasSuggestedProfile ? "Confirm" : "Submit" + hasSuggestedProfile ? LocalText.genericConfirm : LocalText.genericSubmit } @Published var loginError: LoginError? @@ -134,7 +134,7 @@ struct CreateProfileView: View { VStack(spacing: 16) { VStack(alignment: .leading, spacing: 6) { - Text("Name") + Text(LocalText.genericName) .font(.appFootnote) .foregroundColor(.appGrayText) #if os(iOS) diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift index 37f162c5b..6770b96d9 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift @@ -48,7 +48,7 @@ struct EmailLoginFormView: View { } VStack { VStack(alignment: .leading, spacing: 6) { - Text("Email") + Text(LocalText.genericEmail) .font(.appFootnote) .foregroundColor(.appGrayText) TextField("", text: $email) @@ -64,7 +64,7 @@ struct EmailLoginFormView: View { .padding(.bottom, 8) VStack(alignment: .leading, spacing: 6) { - Text("Password") + Text(LocalText.genericPassword) .font(.appFootnote) .foregroundColor(.appGrayText) SecureField("", text: $password) @@ -88,7 +88,7 @@ struct EmailLoginFormView: View { ) } }, - label: { Text("Submit") } + label: { Text(LocalText.genericSubmit) } ) .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, width: 300)) @@ -101,7 +101,7 @@ struct EmailLoginFormView: View { Button( action: { viewModel.emailAuthState = .signUp }, label: { - Text(Localtext.registrationNoAccount) + Text(LocalText.registrationNoAccount) .foregroundColor(.appGrayTextContrast) .underline() } diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift index ba6f39cc1..9ae01eb8c 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift @@ -91,7 +91,7 @@ struct EmailSignupFormView: View { VStack { // Email VStack(alignment: .leading, spacing: 6) { - Text("Email") + Text(LocalText.genericEmail) .font(.appFootnote) .foregroundColor(.appGrayText) TextField("", text: $email) @@ -108,7 +108,7 @@ struct EmailSignupFormView: View { // Password VStack(alignment: .leading, spacing: 6) { - Text("Password") + Text(LocalText.genericPassword) .font(.appFootnote) .foregroundColor(.appGrayText) SecureField("", text: $password) @@ -182,7 +182,7 @@ struct EmailSignupFormView: View { ) } }, - label: { Text("Submit") } + label: { Text(LocalText.genericSubmit) } ) .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, width: 300)) diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/NewAppleSignupView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/NewAppleSignupView.swift index 28ccad613..13e7f0a71 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/NewAppleSignupView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/NewAppleSignupView.swift @@ -48,7 +48,7 @@ struct NewAppleSignupView: View { await viewModel.submitProfile(userProfile: userProfile, authenticator: authenticator) } }, - label: { Text("Continue") } + label: { Text(LocalText.genericContinue) } ) .buttonStyle(SolidCapsuleButtonStyle(color: .appDeepBackground, width: 300)) diff --git a/apple/OmnivoreKit/Sources/App/Views/SelfHostSettingsView.swift b/apple/OmnivoreKit/Sources/App/Views/SelfHostSettingsView.swift index 4cb62cbd7..567663b5c 100644 --- a/apple/OmnivoreKit/Sources/App/Views/SelfHostSettingsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/SelfHostSettingsView.swift @@ -28,7 +28,7 @@ struct SelfHostSettingsView: View { Button(action: { showConfirmAlert = true }, label: { - Text("Save") + Text(LocalText.genericSave) }) .disabled(!allFieldsSet) } @@ -68,7 +68,7 @@ struct SelfHostSettingsView: View { .alert(isPresented: $showConfirmAlert) { Alert( title: Text("Changing your environment settings will close the app."), - dismissButton: .cancel(Text("Ok")) { + dismissButton: .cancel(Text(LocalText.genericOk)) { AppEnvironment.setCustom(serverBaseURL: apiServerAddress, webAppBaseURL: webServerAddress, ttsBaseURL: ttsServerAddress) dataService.switchAppEnvironment(appEnvironment: AppEnvironment.custom) } @@ -80,7 +80,7 @@ struct SelfHostSettingsView: View { .navigationBarItems(leading: Button(action: { dismiss() - }, label: { Text("Cancel") }), + }, label: { Text(LocalText.cancelGeneric) }), trailing: saveButton) } } diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/RecommendToView.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/RecommendToView.swift index 7b4c11e26..35ce3dfc5 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/RecommendToView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/RecommendToView.swift @@ -81,7 +81,7 @@ struct RecommendToView: View { Button(action: { self.viewModel.showNoteView = true }, label: { - Text("Next") + Text(LocalText.genericNext) .bold() }) .disabled(viewModel.selectedGroups.isEmpty) @@ -99,7 +99,7 @@ struct RecommendToView: View { } } }, label: { - Text("Send") + Text(LocalText.genericSend) .bold() }) .disabled(viewModel.selectedGroups.isEmpty) @@ -200,7 +200,7 @@ struct RecommendToView: View { .alert(isPresented: $viewModel.showError) { Alert( title: Text(LocalText.recommendationError), - dismissButton: .cancel(Text("Ok")) { + dismissButton: .cancel(Text(LocalText.genericOk)) { viewModel.showError = false } ) diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index 2940049e8..0b6f6d27c 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -271,7 +271,7 @@ struct WebReaderContainerView: View { .padding(.horizontal) .scaleEffect(navBarVisibilityRatio) #else - Text("Options") + Text(LocalText.genericOptions) #endif } ) @@ -365,7 +365,7 @@ struct WebReaderContainerView: View { if let linkToOpen = linkToOpen { safariWebLink = SafariWebLink(id: UUID(), url: linkToOpen) } - }, label: { Text("Open") }) + }, label: { Text(LocalText.genericOpen) }) Button(action: { UIPasteboard.general.string = item.unwrappedPageURLString showInSnackbar("Link Copied") @@ -381,8 +381,8 @@ struct WebReaderContainerView: View { SafariView(url: $0.url) } #endif - .alert(errorAlertMessage ?? LocalText.readerError, isPresented: $showErrorAlertMessage) { - Button("Ok", role: .cancel, action: { + .alert(errorAlertMessage ?? LocalText.readerError, isPresented: $showErrorAlertMessage) { + Button(LocalText.genericOk, role: .cancel, action: { errorAlertMessage = nil showErrorAlertMessage = false }) diff --git a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift index fdebe1931..466627813 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift @@ -71,9 +71,9 @@ struct WelcomeView: View { var footerView: some View { Group { Text(LocalText.welcomeSignupAgreement) - + Text(LocalText.welcomeTitleTermsOfService).underline() - + Text(LocalText.welcomeTitleAndJoiner) - + Text(LocalText.privacyPolicyGeneric).underline() + + Text(LocalText.welcomeTitleTermsOfService).underline() + + Text(LocalText.welcomeTitleAndJoiner) + + Text(LocalText.privacyPolicyGeneric).underline() } .font(.appSubheadline) .confirmationDialog("", isPresented: $showTermsLinks, titleVisibility: .hidden) { diff --git a/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift b/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift index 3e12773fc..72ad26c2a 100644 --- a/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift +++ b/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift @@ -30,7 +30,7 @@ public struct HighlightAnnotationSheet: View { Spacer() Label("Note", systemImage: "note.text") Spacer() - Button("Save") { + Button(LocalText.genericSave) { onSave() } } @@ -50,7 +50,7 @@ public struct HighlightAnnotationSheet: View { } .padding() .alert(errorAlertMessage ?? LocalText.readerError, isPresented: $showErrorAlertMessage) { - Button("Ok", role: .cancel, action: { + Button(LocalText.genericOk, role: .cancel, action: { errorAlertMessage = nil showErrorAlertMessage = false }) diff --git a/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift b/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift index 96d907667..7405e4777 100644 --- a/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift +++ b/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift @@ -200,7 +200,7 @@ public final class OmnivoreWebView: WKWebView { // on iOS16 we use menuBuilder to create these items } else { let annotate = UIMenuItem(title: "Annotate", action: #selector(annotateSelection)) - let highlight = UIMenuItem(title: "Highlight", action: #selector(highlightSelection)) + let highlight = UIMenuItem(title: LocalText.genericHighlight, action: #selector(highlightSelection)) // let share = UIMenuItem(title: "Share", action: #selector(shareSelection)) UIMenuController.shared.menuItems = [highlight, /* share, */ annotate] @@ -315,7 +315,7 @@ public final class OmnivoreWebView: WKWebView { override public func buildMenu(with builder: UIMenuBuilder) { if #available(iOS 16.0, *) { let annotate = UICommand(title: "Note", action: #selector(annotateSelection)) - let highlight = UICommand(title: "Highlight", action: #selector(highlightSelection)) + let highlight = UICommand(title: LocalText.genericHighlight, action: #selector(highlightSelection)) let remove = UICommand(title: "Remove", action: #selector(removeSelection)) let setLabels = UICommand(title: LocalText.labelsGeneric, action: #selector(setLabels)) diff --git a/apple/OmnivoreKit/Sources/Views/FontSizeAdjustmentPopoverView.swift b/apple/OmnivoreKit/Sources/Views/FontSizeAdjustmentPopoverView.swift index e690cac9c..c10fe5c00 100644 --- a/apple/OmnivoreKit/Sources/Views/FontSizeAdjustmentPopoverView.swift +++ b/apple/OmnivoreKit/Sources/Views/FontSizeAdjustmentPopoverView.swift @@ -175,7 +175,7 @@ public enum WebFont: String, CaseIterable { NavigationLink(destination: fontList) { HStack { - Text("Font") + Text(LocalText.genericFont) Spacer() Image(systemName: "chevron.right") // Button(action: {}, label: { Text("Crimson Text").frame(width: 91) }) diff --git a/apple/OmnivoreKit/Sources/Views/Resources/en.lproj/Localizable.strings b/apple/OmnivoreKit/Sources/Views/Resources/en.lproj/Localizable.strings index 25186c59c..5b521c4f4 100644 --- a/apple/OmnivoreKit/Sources/Views/Resources/en.lproj/Localizable.strings +++ b/apple/OmnivoreKit/Sources/Views/Resources/en.lproj/Localizable.strings @@ -193,7 +193,7 @@ "dismissButton" = "Dismiss"; "errorNetwork" = "We are having trouble connecting to the internet."; -// TODO: search navigationTitle, toggle, section, button, Label +// TODO: search navigationTitle, toggle, section, button, Label, title: ", CreateProfileViewModel, TextField, .keyboardShortcut // Unit test Entry -- Do not remove this or add entries after this one. // This allows us to check for syntax errors in this file with a unit test