From f8609a1d8077b9900804468235f5d2d3f5483206 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Tue, 24 Jan 2023 14:02:37 -0800 Subject: [PATCH] update some local text refs --- .../Views/AudioPlayer/ExpandedPlayer.swift | 2 +- .../Views/Highlights/HighlightsListCard.swift | 2 +- .../Views/Highlights/HighlightsListView.swift | 4 +- .../Sources/App/Views/Labels/LabelsView.swift | 2 +- .../OmnivoreKit/Sources/Views/LocalText.swift | 180 +++++++++++++++++- .../Resources/en.lproj/Localizable.strings | 3 - .../zh-Hans.lproj/Localizable.strings | 3 - 7 files changed, 180 insertions(+), 16 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift index 1fde8a399..1b84f8ce5 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift @@ -205,7 +205,7 @@ Image(systemName: "gobackward") .font(.appCallout) .tint(.appGrayTextContrast) - Text("Replay") + Text(LocalText.audioPlayerReplay) } } ).buttonStyle(RoundedRectButtonStyle()) diff --git a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift index 189f1066a..c2eb00567 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListCard.swift @@ -128,7 +128,7 @@ struct HighlightsListCard: View { .foregroundColor(.appGrayText) .frame(width: 14, height: 14) } - Text("Highlight by \(highlightParams.createdBy?.name ?? "you")") + Text("\(LocalText.highlightCardHighlightByOther)\(highlightParams.createdBy?.name ?? "you")") // TODO: fix translation...add other/you .font(.appFootnote) .foregroundColor(.appGrayText) } diff --git a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListView.swift b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListView.swift index 2a0e9bfe9..3432f73a1 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Highlights/HighlightsListView.swift @@ -14,9 +14,7 @@ struct HighlightsListView: View { @State var setLabelsHighlight: Highlight? var emptyView: some View { - Text(""" - You have not added any highlights or notes to this page. - """) + Text(LocalText.highlightCardNoHighlightsOnPage) .multilineTextAlignment(.center) .padding(16) } diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift index c6f04bbc9..c4dac6a0b 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift @@ -116,7 +116,7 @@ struct CreateLabelView: View { if !newLabelName.isEmpty, newLabelColor != .clear { TextChip(text: newLabelName, color: newLabelColor) } else { - Text("Assign a name and color.").font(.appBody) + Text(LocalText.labelsViewAssignNameColor).font(.appBody) } Spacer() } diff --git a/apple/OmnivoreKit/Sources/Views/LocalText.swift b/apple/OmnivoreKit/Sources/Views/LocalText.swift index 53126b10c..e4f9fba18 100644 --- a/apple/OmnivoreKit/Sources/Views/LocalText.swift +++ b/apple/OmnivoreKit/Sources/Views/LocalText.swift @@ -5,9 +5,7 @@ public enum LocalText { NSLocalizedString(key, bundle: .module, comment: comment ?? "no comment provided by developer") } - // share extension - public static let shareExtensionCreateLabel = localText(key: "shareExtensionCreateLabel") - public static let shareExtensionMoreActions = localText(key: "shareExtensionMoreActions") + // Share extension public static let saveArticleSavedState = localText(key: "saveArticleSavedState") public static let saveArticleProcessingState = localText(key: "saveArticleProcessingState") public static let extensionAppUnauthorized = localText(key: "extensionAppUnauthorized") @@ -16,7 +14,6 @@ public enum LocalText { public static let audioPlayerReplay = localText(key: "audioPlayerReplay") // Highlights List Card - public static let highlightCardHighlightByYou = localText(key: "highlightCardHighlightByYou") public static let highlightCardHighlightByOther = localText(key: "highlightCardHighlightByOther") public static let highlightCardNoHighlightsOnPage = localText(key: "highlightCardNoHighlightsOnPage") @@ -192,3 +189,178 @@ public enum LocalText { public static let dismissButton = localText(key: "dismissButton") public static let errorNetwork = localText(key: "errorNetwork") } + +//// Manage Account View +// "manageAccountDelete" = "Delete Account"; +// "manageAccountResetCache" = "Reset Data Cache"; +// "manageAccountConfirmDeleteMessage" = "Are you sure you want to delete your account? This action can't be undone."; +// +//// Newsletter Emails View +// "newsletterEmailsExisting" = "Existing Emails (Tap to copy)"; +// "createNewEmailMessage" = "创建新的电子邮件地址"; +// "newslettersDescription" = "将 PDF 添加到您的资料库,或使用 Omnivore 电子邮件地址订阅新闻稿件。"; +// "noCurrentSubscriptionsMessage" = "您当前没有任何订阅。"; +// +//// Profile View +// "profileConfirmLogoutMessage" = "Are you sure you want to logout?"; +// +//// Devices View +// "devicesTokensTitle" = "Registered device tokens (swipe to remove)"; +// "devicesCreated" = "Created: "; +// +//// Push Notification Settings +// "notificationsEnabled" = "Notifications Enabled"; +// "notificationsExplainer" = "Enabling push notifications gives Omnivore device permission to send notifications,\nbut you are in charge of which notifications are sent."; +// "notificationsTriggerExplainer" = "Push notifications are triggered using your \n[account rules](https://omnivore.app/settings/rules) which you can edit online."; +// "notificationsEnable" = "Enable Push Notifications?"; +// "notificationsGeneralExplainer" = "Get notified when newsletter links reach your inbox. Or receive reminders that you set from our share extension."; +// "notificationsOptionDeny" = "No Thanks"; +// "notificationsOptionEnable" = "Yes Please"; +// +//// Community Modal +// "communityHeadline" = "Help build the Omnivore Community"; +// "communityAppstoreReview" = "Review on the AppStore"; +// "communityTweet" = "Tweet about Omnivore"; +// "communityFollowTwitter" = "Follow us on Twitter"; +// "communityJoinDiscord" = "Join us on Discord"; +// "communityStarGithub" = "Star on GitHub"; +// +//// Clubs View +// "clubsLearnTitle" = "Learn more about clubs"; +// "clubsName" = "Club Name"; +// "clubsCreate" = "Create a new club"; +// "clubsYours" = "Your clubs"; +// "clubsNotAMemberMessage" = "You are not a member of any clubs.\nCreate +// a new club and send the invite link to your friends get started.\n\nDuring the beta you are limited to creating three clubs, and each club\ncan have a maximum of twelve users." +// "clubsErrorCopying" = "Error copying invite URL"; +// "clubsAdminDenyViewing" = "The admin of this club does not allow viewing all members."; +// "clubsNoMembers" = "This club does not have any members. Add users to your club by sending\nthem the invite link."; +// "clubsLeave" = "Leave Club"; +// "clubsLeaveConfirm" = "Are you sure you want to leave this club? No data will be deleted, but you will stop receiving recommendations from the club."; +// "clubsNoneJoined" = "You do not have any clubs you can post to.\nJoin a club or create your own to start recommending articles."; +// +//// Subscriptions +// "subscriptionsErrorRetrieving" = "Sorry, we were unable to retrieve your subscriptions."; +// "subscriptionsNone" = "You have no current subscriptions."; +////"subscriptions.error.retrieving" = "Last received: \(updatedDate.formatted())"; // unused for now +// +//// Text to Speech +// "texttospeechLanguageDefault" = "Default Language"; +// "texttospeechSettingsAudio" = "Audio Settings"; +// "texttospeechSettingsEnablePrefetch" = "Enable audio prefetch"; +// "texttospeechBetaSignupInProcess" = "Signing up for beta"; +// "texttospeechBetaRealisticVoiceLimit" = "You are in the ultra realistic voices beta. During the beta you can listen to 10,000 words of audio per day."; +// "texttospeechBetaRequestReceived" = "Your request to join the ultra realistic voices demo has been received. You will be informed by email when a spot is available."; +// "texttospeechBetaWaitlist" = "Ultra realistic voices are currently in limited beta. Enabling the feature will add you to the beta queue."; +// +//// Sign in/up +// "registrationNoAccount" = "Don't have an account?"; +// "registrationForgotPassword" = "Forgot your password?"; +// "registrationStatusCheck" = "Check Status"; +// "registrationUseDifferentEmail" = "Use a different email?"; +// "registrationFullName" = "Full Name"; +// "registrationUsername" = "Username"; +// "registrationAlreadyHaveAccount" = "Already have an account?"; +// "registrationBio" = "Bio (optional)"; +// "registrationWelcome" = "Welcome to Omnivore!"; +// "registrationUsernameAssignedPrefix" = "Your username is:"; +// "registrationChangeUsername" = "Change Username"; +// "registrationEdit" = "Edit"; +// "googleAuthButton" = "使用 Google 账号"; +// "registrationViewSignUpHeadline" = "注册"; +// "loginErrorInvalidCreds" = "提供的登录凭据无效."; +// +//// Recommendation +// "recommendationToPrefix" = "To:"; +// "recommendationAddNote" = "Add a note (optional)"; +////"recommendationToPrefix" = "Include your \(viewModel.highlightCount) highlight\(viewModel.highlightCount > 1 ? "s" : """; // unused for now +// "recommendationError" = "Error recommending this page"; +// +//// Web Reader +// "readerCopyLink" = "Copy Link"; +// "readerSave" = "Save to Omnivore"; +// "readerError" = "An error occurred"; +// +//// Debug Menu +// "menuDebugTitle" = "Debug Menu"; +// "menuDebugApiEnv" = "API Environment:"; +// +//// Navigation +// "navigationSelectLink" = "Select a link from the feed"; +// "navigationSelectSidebarToggle" = "Toggle sidebar"; +// +//// Welcome View +// "welcomeTitle" = "Read-it-later for serious readers."; +// "welcomeLearnMore" = "Learn more"; +// "welcomeSignupAgreement" = "By signing up, you agree to Omnivore’s\n"; +// "welcomeTitleTermsOfService" = "Terms of Service"; +// "welcomeTitleAndJoiner" = " and "; +// "welcomeTitleEmailContinue" = "Continue with Email"; +// +//// Keyboard Commands +// "keyboardCommandDecreaseFont" = "Decrease Font Size"; +// "keyboardCommandIncreaseFont" = "Increase Font Size"; +// "keyboardCommandDecreaseMargin" = "Decrease Margin"; +// "keyboardCommandIncreaseMargin" = "Increase Margin"; +// "keyboardCommandDecreaseLineSpacing" = "Decrease Line Spacing"; +// "keyboardCommandIncreaseLineSpacing" = "Increase Line Spacing"; +// +//// Library +////"library.by.author.suffix" = "by \(author)" // unused +////"Recommended by \(byStr) in \(inStr)" // unused +// +// +//// Generic +// "genericSnooze" = "Snooze"; +// "genericClose" = "Close"; +// "genericCreate" = "Create"; +// "genericConfirm" = "Confirm"; +// "genericProfile" = "Profile"; +// "genericNext" = "Next"; +// "genericName" = "Name"; +// "genericOk" = "Ok"; +// "genericRetry" = "Retry"; +// "genericEmail" = "Email"; +// "genericPassword" = "Password"; +// "genericSubmit" = "Submit"; +// "genericContinue" = "Continue"; +// "genericSend" = "Send"; +// "genericOptions" = "Options"; +// "genericOpen" = "Open"; +// "genericChangeApply" = "Apply Changes"; +// "genericTitle" = "Title"; +// "genericAuthor" = "Author"; +// "genericDescription" = "Description"; +// "genericSave" = "Save"; +// "genericLoading" = "Loading..."; +// "genericFontFamily" = "Font Family"; +// "genericHighContrastText" = "High Contrast Text"; +// "genericFont" = "Font"; +// "genericHighlight" = "Highlight"; +// "labelsGeneric" = "标签"; +// "emailsGeneric" = "电子邮件"; +// "subscriptionsGeneric" = "订阅"; +// "textToSpeechGeneric" = "文章转语音"; +// "privacyPolicyGeneric" = "隐私策略"; +// "termsAndConditionsGeneric" = "条款与条件"; +// "feedbackGeneric" = "反馈"; +// "manageAccountGeneric" = "管理帐户"; +// "logoutGeneric" = "退出登陆"; +// "doneGeneric" = "完成"; +// "cancelGeneric" = "取消"; +// "inboxGeneric" = "收集箱"; +// "readLaterGeneric" = "稍后阅读"; +// "newslettersGeneric" = "新闻稿件"; +// "allGeneric" = "全部"; +// "archivedGeneric" = "存档"; +// "highlightedGeneric" = "荧光笔"; +// "filesGeneric" = "文件"; +// "newestGeneric" = "最新"; +// "oldestGeneric" = "最早"; +// "recentlyReadGeneric" = "最近阅读"; +// "recentlyPublishedGeneric" = "最近发布"; +// "clubsGeneric" = "读书俱乐部"; +// "errorGeneric" = "哦!出现了小问题,请您重试."; +// "pushNotificationsGeneric" = "推送通知"; +// "dismissButton" = "撤回"; +// "errorNetwork" = "我们在连接到互联网时遇到问题."; diff --git a/apple/OmnivoreKit/Sources/Views/Resources/en.lproj/Localizable.strings b/apple/OmnivoreKit/Sources/Views/Resources/en.lproj/Localizable.strings index e9f7167fe..77c6164c4 100644 --- a/apple/OmnivoreKit/Sources/Views/Resources/en.lproj/Localizable.strings +++ b/apple/OmnivoreKit/Sources/Views/Resources/en.lproj/Localizable.strings @@ -1,6 +1,4 @@ // share extension -"shareExtensionCreateLabel" = "Create Label"; -"shareExtensionMoreActions" = "More Actions"; "saveArticleSavedState" = "Saved to Omnivore"; "saveArticleProcessingState" = "Saved to Omnivore"; "extensionAppUnauthorized" = "Please login to Omnivore from the app before saving your first link."; @@ -9,7 +7,6 @@ "audioPlayerReplay" = "Replay"; // Highlights List Card -"highlightCardHighlightByYou" = "Highlight by you"; "highlightCardHighlightByOther" = "Highlight by "; "highlightCardNoHighlightsOnPage" = "You have not added any highlights or notes to this page."; diff --git a/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings b/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings index 36ed18392..0e5248d0a 100644 --- a/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings +++ b/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings @@ -1,6 +1,4 @@ // share extension -"shareExtensionCreateLabel" = "Create Label"; -"shareExtensionMoreActions" = "More Actions"; "saveArticleSavedState" = "正在保存到 Omnivore 中"; "saveArticleProcessingState" = "已经保存到 Omnivore 中"; "extensionAppUnauthorized" = "请在保存您的第一个链接之前从应用程序登录 Omnivore."; @@ -9,7 +7,6 @@ "audioPlayerReplay" = "Replay"; // Highlights List Card -"highlightCardHighlightByYou" = "Highlight by you"; "highlightCardHighlightByOther" = "Highlight by "; "highlightCardNoHighlightsOnPage" = "You have not added any highlights or notes to this page.";