Skip to content

Commit b486452

Browse files
authored
fix(localization): adding in some missed strings (#442)
1 parent cb7ab9b commit b486452

File tree

5 files changed

+33
-6
lines changed

5 files changed

+33
-6
lines changed

PocketKit/Sources/PocketKit/MyList/ItemsList/ItemsListItemPresenter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ class ItemsListItemPresenter {
9696
private var timeToRead: String? {
9797
item.timeToRead
9898
.flatMap { $0 > 0 ? $0 : nil }
99-
.flatMap { "\($0) min" }
99+
.flatMap { L10n.Item.List.min($0) }
100100
}
101101
}

PocketKit/Sources/PocketKit/MyList/SearchItemsList/SearchView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct ResultsView: View {
6161
.accessibilityIdentifier("search-results")
6262
.banner(data: viewModel.bannerData, show: $viewModel.showBanner)
6363
.alert(isPresented: $showingAlert) {
64-
Alert(title: Text("You must have an internet connection to view this item."), dismissButton: .default(Text("OK")))
64+
Alert(title: Text(L10n.Search.Error.View.needsInternet), dismissButton: .default(Text("OK")))
6565
}
6666
}
6767
}
@@ -84,7 +84,7 @@ struct RecentSearchView: View {
8484

8585
var body: some View {
8686
List {
87-
Section(header: Text("Recent Searches").style(.search.header)) {
87+
Section(header: Text(L10n.Search.recent).style(.search.header)) {
8888
ForEach(recentSearches.reversed(), id: \.self) { recentSearch in
8989
HStack {
9090
Text(recentSearch)

PocketKit/Sources/PocketKit/Resources/en.lproj/Localizable.strings

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"Unfavorite" = "Unfavorite";
4141
"Move to Saves" = "Move to Saves";
4242
"Add Tags" = "Add Tags";
43+
"Tags" = "Tags";
4344
"Share" = "Share";
4445

4546
"Saves" = "Saves";
@@ -106,6 +107,7 @@
106107
"Delete" = "Delete";
107108
"Cancel" = "Cancel";
108109
"Rename Tag" = "Rename Tag";
110+
"Rename" = "Rename";
109111
"Enter a new name for this tag" = "Enter a new name for this tag";
110112

111113
"not tagged" = "not tagged";
@@ -131,6 +133,8 @@
131133
"search.limitedResults" = "Limited search results";
132134
"search.offlineMessage" = "You can only search titles and URLs while offline. Connect to the internet to use Premium's full-text search.";
133135
"search.banner.errorMessage." = "We’re experiencing an error and can’t show you full search results. Please try again later.";
136+
"search.error.view.needsInternet" = "You must have an internet connection to view this item.";
137+
"search.recent" = "Recent Searches";
134138

135139
// Settings
136140
"settings.thankyou.credits" = "Thank you for using Pocket";
@@ -139,3 +143,6 @@
139143
"settings.logout" = "Log Out";
140144
"settings.logout.areYouSureMessage" = "You will be logged out of your account and any items that have been saved for offline viewing will be removed from your device.";
141145
"settings.logout.areyousure" = "Are you sure?";
146+
147+
//List view
148+
"item.list.min" = "%@ min";

PocketKit/Sources/PocketKit/Strings.swift

+20
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ internal enum L10n {
129129
internal static let privacyPolicy = L10n.tr("Localizable", "Privacy Policy", fallback: "Privacy Policy")
130130
/// Recent Saves
131131
internal static let recentSaves = L10n.tr("Localizable", "Recent Saves", fallback: "Recent Saves")
132+
/// Rename
133+
internal static let rename = L10n.tr("Localizable", "Rename", fallback: "Rename")
132134
/// Rename Tag
133135
internal static let renameTag = L10n.tr("Localizable", "Rename Tag", fallback: "Rename Tag")
134136
/// Report
@@ -173,6 +175,8 @@ internal enum L10n {
173175
internal static let tagYourSavesByTopicToFindThemLater = L10n.tr("Localizable", "Tag your saves by topic to find them later.", fallback: "Tag your saves by topic to find them later.")
174176
/// Tagged
175177
internal static let tagged = L10n.tr("Localizable", "Tagged", fallback: "Tagged")
178+
/// Tags
179+
internal static let tags = L10n.tr("Localizable", "Tags", fallback: "Tags")
176180
/// Tell us more
177181
internal static let tellUsMore = L10n.tr("Localizable", "Tell us more", fallback: "Tell us more")
178182
/// Terms of Service
@@ -202,6 +206,14 @@ internal enum L10n {
202206
/// Save from Safari, Twitter, YouTube or your favorite news app (for starters). Your articles and videos will be ready for you in Pocket
203207
internal static let yourArticlesAndVideosWillBeReadyForYouInPocket = L10n.tr("Localizable", "Save from Safari, Twitter, YouTube or your favorite news app (for starters). Your articles and videos will be ready for you in Pocket", fallback: "Save from Safari, Twitter, YouTube or your favorite news app (for starters). Your articles and videos will be ready for you in Pocket")
204208
}
209+
internal enum Item {
210+
internal enum List {
211+
/// %@ min
212+
internal static func min(_ p1: Any) -> String {
213+
return L10n.tr("Localizable", "item.list.min", String(describing: p1), fallback: "%@ min")
214+
}
215+
}
216+
}
205217
internal enum Search {
206218
/// Oops! Try again?
207219
internal static let errorHeadline = L10n.tr("Localizable", "search.errorHeadline", fallback: "Oops! Try again?")
@@ -211,10 +223,18 @@ internal enum L10n {
211223
internal static let limitedResults = L10n.tr("Localizable", "search.limitedResults", fallback: "Limited search results")
212224
/// You can only search titles and URLs while offline. Connect to the internet to use Premium's full-text search.
213225
internal static let offlineMessage = L10n.tr("Localizable", "search.offlineMessage", fallback: "You can only search titles and URLs while offline. Connect to the internet to use Premium's full-text search.")
226+
/// Recent Searches
227+
internal static let recent = L10n.tr("Localizable", "search.recent", fallback: "Recent Searches")
214228
internal enum Banner {
215229
/// We’re experiencing an error and can’t show you full search results. Please try again later.
216230
internal static let errorMessage = L10n.tr("Localizable", "search.banner.errorMessage.", fallback: "We’re experiencing an error and can’t show you full search results. Please try again later.")
217231
}
232+
internal enum Error {
233+
internal enum View {
234+
/// You must have an internet connection to view this item.
235+
internal static let needsInternet = L10n.tr("Localizable", "search.error.view.needsInternet", fallback: "You must have an internet connection to view this item.")
236+
}
237+
}
218238
}
219239
internal enum Settings {
220240
/// Log Out

PocketKit/Sources/PocketKit/Tags/TagsFilterView.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ struct EditBottomBar: View {
119119

120120
var body: some View {
121121
HStack {
122-
Button("Rename") {
122+
Button(L10n.rename) {
123123
tagsSelected = selection
124124
showRenameAlert = true
125125
}
126126
.disabled(selection.count != 1)
127127
.accessibilityIdentifier("rename-button")
128128
Spacer()
129-
Button("Delete") {
129+
Button(L10n.delete) {
130130
tagsSelected = selection
131131
showDeleteAlert = true
132132
}
@@ -145,7 +145,7 @@ struct TagsHeaderToolBar: ViewModifier {
145145
.toolbar {
146146
ToolbarItem(placement: .principal) {
147147
VStack {
148-
Text("Tags").style(.tagsFilter.sectionHeader)
148+
Text(L10n.tags).style(.tagsFilter.sectionHeader)
149149
}
150150
}
151151
ToolbarItem(placement: .navigationBarLeading) {

0 commit comments

Comments
 (0)