[CHANGE] Extracted all strings into the Localizable.strings

This commit is contained in:
Fabian Thies
2023-01-16 21:23:16 +01:00
parent 0000610b9d
commit f90bf3bfcf
9 changed files with 91 additions and 24 deletions

View File

@@ -10,6 +10,12 @@ import Foundation
// swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length // swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length
// swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces // swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces
internal enum L10n { internal enum L10n {
internal enum Action {
/// Close
internal static let close = L10n.tr("Localizable", "Action.close", fallback: "Close")
/// General Actions
internal static let done = L10n.tr("Localizable", "Action.done", fallback: "Done")
}
internal enum AddSourceView { internal enum AddSourceView {
/// Continue /// Continue
internal static let `continue` = L10n.tr("Localizable", "AddSourceView.continue", fallback: "Continue") internal static let `continue` = L10n.tr("Localizable", "AddSourceView.continue", fallback: "Continue")
@@ -49,7 +55,7 @@ internal enum L10n {
internal static let restoreBackup = L10n.tr("Localizable", "AppAction.restoreBackup", fallback: "Restore backup") internal static let restoreBackup = L10n.tr("Localizable", "AppAction.restoreBackup", fallback: "Restore backup")
} }
internal enum AppDetailView { internal enum AppDetailView {
/// AppDetailView /// More...
internal static let more = L10n.tr("Localizable", "AppDetailView.more", fallback: "More...") internal static let more = L10n.tr("Localizable", "AppDetailView.more", fallback: "More...")
/// The app requires no permissions. /// The app requires no permissions.
internal static let noPermissions = L10n.tr("Localizable", "AppDetailView.noPermissions", fallback: "The app requires no permissions.") internal static let noPermissions = L10n.tr("Localizable", "AppDetailView.noPermissions", fallback: "The app requires no permissions.")
@@ -61,6 +67,20 @@ internal enum L10n {
internal static let version = L10n.tr("Localizable", "AppDetailView.version", fallback: "Version") internal static let version = L10n.tr("Localizable", "AppDetailView.version", fallback: "Version")
/// What's New /// What's New
internal static let whatsNew = L10n.tr("Localizable", "AppDetailView.whatsNew", fallback: "What's New") internal static let whatsNew = L10n.tr("Localizable", "AppDetailView.whatsNew", fallback: "What's New")
internal enum Badge {
/// AppDetailView
internal static let official = L10n.tr("Localizable", "AppDetailView.Badge.official", fallback: "Official App")
/// From Trusted Source
internal static let trusted = L10n.tr("Localizable", "AppDetailView.Badge.trusted", fallback: "From Trusted Source")
}
}
internal enum AppIDsView {
/// Each app and app extension installed with SideStore must register an App ID with Apple.
///
/// App IDs for paid developer accounts never expire, and there is no limit to how many you can create.
internal static let description = L10n.tr("Localizable", "AppIDsView.description", fallback: "Each app and app extension installed with SideStore must register an App ID with Apple.\n\nApp IDs for paid developer accounts never expire, and there is no limit to how many you can create.")
/// AppIDsView
internal static let title = L10n.tr("Localizable", "AppIDsView.title", fallback: "App IDs")
} }
internal enum AppPermissionGrid { internal enum AppPermissionGrid {
/// AppPermissionGrid /// AppPermissionGrid
@@ -72,6 +92,10 @@ internal enum L10n {
/// Open /// Open
internal static let `open` = L10n.tr("Localizable", "AppPillButton.open", fallback: "Open") internal static let `open` = L10n.tr("Localizable", "AppPillButton.open", fallback: "Open")
} }
internal enum AppRowView {
/// AppRowView
internal static let sideloaded = L10n.tr("Localizable", "AppRowView.sideloaded", fallback: "Sideloaded")
}
internal enum BrowseView { internal enum BrowseView {
/// Search /// Search
internal static let search = L10n.tr("Localizable", "BrowseView.search", fallback: "Search") internal static let search = L10n.tr("Localizable", "BrowseView.search", fallback: "Search")
@@ -86,6 +110,16 @@ internal enum L10n {
/// Emulators /// Emulators
internal static let gamesAndEmulators = L10n.tr("Localizable", "BrowseView.Categories.gamesAndEmulators", fallback: "Games and\nEmulators") internal static let gamesAndEmulators = L10n.tr("Localizable", "BrowseView.Categories.gamesAndEmulators", fallback: "Games and\nEmulators")
} }
internal enum Hints {
internal enum NoApps {
/// Add Source
internal static let addSource = L10n.tr("Localizable", "BrowseView.Hints.NoApps.addSource", fallback: "Add Source")
/// Apps are provided by "sources". The specification for them is an open standard, so everyone can create their own source. To get you started, we have compiled a list of "Trusted Sources" which you can check out by tapping the button below.
internal static let text = L10n.tr("Localizable", "BrowseView.Hints.NoApps.text", fallback: "Apps are provided by \"sources\". The specification for them is an open standard, so everyone can create their own source. To get you started, we have compiled a list of \"Trusted Sources\" which you can check out by tapping the button below.")
/// You don't have any apps yet.
internal static let title = L10n.tr("Localizable", "BrowseView.Hints.NoApps.title", fallback: "You don't have any apps yet.")
}
}
internal enum Section { internal enum Section {
internal enum AllApps { internal enum AllApps {
/// All Apps /// All Apps
@@ -146,16 +180,24 @@ internal enum L10n {
internal static let failedToRefresh = L10n.tr("Localizable", "MyAppsView.failedToRefresh", fallback: "Failed to refresh") internal static let failedToRefresh = L10n.tr("Localizable", "MyAppsView.failedToRefresh", fallback: "Failed to refresh")
/// My Apps /// My Apps
internal static let myApps = L10n.tr("Localizable", "MyAppsView.myApps", fallback: "My Apps") internal static let myApps = L10n.tr("Localizable", "MyAppsView.myApps", fallback: "My Apps")
/// No Updates Available
internal static let noUpdatesAvailable = L10n.tr("Localizable", "MyAppsView.noUpdatesAvailable", fallback: "No Updates Available")
/// Refresh All /// Refresh All
internal static let refreshAll = L10n.tr("Localizable", "MyAppsView.refreshAll", fallback: "Refresh All") internal static let refreshAll = L10n.tr("Localizable", "MyAppsView.refreshAll", fallback: "Refresh All")
/// Active
internal static let remainingAppID = L10n.tr("Localizable", "MyAppsView.remainingAppID", fallback: "Active")
/// Sideloading in progress... /// Sideloading in progress...
internal static let sideloading = L10n.tr("Localizable", "MyAppsView.sideloading", fallback: "Sideloading in progress...") internal static let sideloading = L10n.tr("Localizable", "MyAppsView.sideloading", fallback: "Sideloading in progress...")
/// Keep this lowercase /// Keep this lowercase
internal static let viewAppIDs = L10n.tr("Localizable", "MyAppsView.viewAppIDs", fallback: "View App IDs") internal static let viewAppIDs = L10n.tr("Localizable", "MyAppsView.viewAppIDs", fallback: "View App IDs")
internal enum Hints {
internal enum NoUpdates {
/// Dismiss for now
internal static let dismissForNow = L10n.tr("Localizable", "MyAppsView.Hints.NoUpdates.dismissForNow", fallback: "Dismiss for now")
/// Don't show this again
internal static let dontShowAgain = L10n.tr("Localizable", "MyAppsView.Hints.NoUpdates.dontShowAgain", fallback: "Don't show this again")
/// You will be notified once updates for your apps are available. The updates will then be shown here.
internal static let text = L10n.tr("Localizable", "MyAppsView.Hints.NoUpdates.text", fallback: "You will be notified once updates for your apps are available. The updates will then be shown here.")
/// All Apps are Up To Date
internal static let title = L10n.tr("Localizable", "MyAppsView.Hints.NoUpdates.title", fallback: "All Apps are Up To Date")
}
}
} }
internal enum NewsView { internal enum NewsView {
/// NewsView /// NewsView

View File

@@ -7,6 +7,11 @@
*/ */
/* General Actions */
"Action.done" = "Done";
"Action.close" = "Close";
/* NewsView */ /* NewsView */
"NewsView.title" = "News"; "NewsView.title" = "News";
"NewsView.Section.FromSources.title" = "From your Sources"; "NewsView.Section.FromSources.title" = "From your Sources";
@@ -18,9 +23,19 @@
"BrowseView.Section.PromotedCategories.title" = "Promoted Categories"; "BrowseView.Section.PromotedCategories.title" = "Promoted Categories";
"BrowseView.Section.PromotedCategories.showAll" = "Show all"; "BrowseView.Section.PromotedCategories.showAll" = "Show all";
"BrowseView.Section.AllApps.title" = "All Apps"; "BrowseView.Section.AllApps.title" = "All Apps";
"BrowseView.Hints.NoApps.title" = "You don't have any apps yet.";
"BrowseView.Hints.NoApps.text" = "Apps are provided by \"sources\". The specification for them is an open standard, so everyone can create their own source. To get you started, we have compiled a list of \"Trusted Sources\" which you can check out by tapping the button below.";
"BrowseView.Hints.NoApps.addSource" = "Add Source";
"BrowseView.Actions.sources" = "Sources"; "BrowseView.Actions.sources" = "Sources";
"BrowseView.Categories.gamesAndEmulators" = "Games and\nEmulators"; "BrowseView.Categories.gamesAndEmulators" = "Games and\nEmulators";
/* AppRowView */
"AppRowView.sideloaded" = "Sideloaded";
/* AppPillButton */
"AppPillButton.free" = "Free";
"AppPillButton.open" = "Open";
/* RootView */ /* RootView */
"RootView.news" = "News"; "RootView.news" = "News";
"RootView.browse" = "Browse"; "RootView.browse" = "Browse";
@@ -102,6 +117,8 @@
"AppAction.resetIcon" = "Reset icon"; "AppAction.resetIcon" = "Reset icon";
/* AppDetailView*/ /* AppDetailView*/
"AppDetailView.Badge.official" = "Official App";
"AppDetailView.Badge.trusted" = "From Trusted Source";
"AppDetailView.more" = "More..."; "AppDetailView.more" = "More...";
"AppDetailView.whatsNew" = "What's New"; "AppDetailView.whatsNew" = "What's New";
"AppDetailView.version" = "Version"; "AppDetailView.version" = "Version";
@@ -117,8 +134,16 @@
"MyAppsView.sideloading" = "Sideloading in progress..."; "MyAppsView.sideloading" = "Sideloading in progress...";
"MyAppsView.refreshAll" = "Refresh All"; "MyAppsView.refreshAll" = "Refresh All";
"MyAppsView.appIDsRemaining" = "App IDs Remaining"; "MyAppsView.appIDsRemaining" = "App IDs Remaining";
"MyAppsView.noUpdatesAvailable" = "No Updates Available";
"MyAppsView.failedToRefresh" = "Failed to refresh"; "MyAppsView.failedToRefresh" = "Failed to refresh";
"MyAppsView.apps" = "apps"; /* Keep this lowercase */ "MyAppsView.apps" = "apps"; /* Keep this lowercase */
"MyAppsView.viewAppIDs" = "View App IDs"; "MyAppsView.viewAppIDs" = "View App IDs";
"MyAppsView.myApps" = "My Apps"; "MyAppsView.myApps" = "My Apps";
"MyAppsView.Hints.NoUpdates.title" = "All Apps are Up To Date";
"MyAppsView.Hints.NoUpdates.text" = "You will be notified once updates for your apps are available. The updates will then be shown here.";
"MyAppsView.Hints.NoUpdates.dismissForNow" = "Dismiss for now";
"MyAppsView.Hints.NoUpdates.dontShowAgain" = "Don't show this again";
/* AppIDsView */
"AppIDsView.title" = "App IDs";
"AppIDsView.description" = "Each app and app extension installed with SideStore must register an App ID with Apple.\n\nApp IDs for paid developer accounts never expire, and there is no limit to how many you can create.";

View File

@@ -44,10 +44,10 @@ struct AppPillButton: View {
return DateFormatterHelper.string(forExpirationDate: installedApp.expirationDate) return DateFormatterHelper.string(forExpirationDate: installedApp.expirationDate)
} }
return "Open" return L10n.AppPillButton.open
} }
return "Free" return L10n.AppPillButton.free
} }
var body: some View { var body: some View {

View File

@@ -26,7 +26,7 @@ struct AppRowView: View {
Text(app.name) Text(app.name)
.bold() .bold()
Text(storeApp?.developerName ?? "Sideloaded") Text(storeApp?.developerName ?? L10n.AppRowView.sideloaded)
.font(.callout) .font(.callout)
.foregroundColor(.secondary) .foregroundColor(.secondary)

View File

@@ -138,7 +138,7 @@ struct AppDetailView: View {
HStack { HStack {
Spacer() Spacer()
Image(systemSymbol: .checkmarkSealFill) Image(systemSymbol: .checkmarkSealFill)
Text("Official App") Text(L10n.AppDetailView.Badge.official)
Spacer() Spacer()
} }
.foregroundColor(.accentColor) .foregroundColor(.accentColor)
@@ -148,7 +148,7 @@ struct AppDetailView: View {
HStack { HStack {
Spacer() Spacer()
Image(systemSymbol: .shieldLefthalfFill) Image(systemSymbol: .shieldLefthalfFill)
Text("From Trusted Source") Text(L10n.AppDetailView.Badge.trusted)
Spacer() Spacer()
} }
.foregroundColor(.accentColor) .foregroundColor(.accentColor)

View File

@@ -44,11 +44,11 @@ struct AppScreenshotsPreview: View {
} }
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never)) .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
.toolbar { .toolbar {
ToolbarItem(placement: .navigationBarTrailing) { ToolbarItem(placement: .cancellationAction) {
SwiftUI.Button { SwiftUI.Button {
self.dismiss() self.dismiss()
} label: { } label: {
Text("Close") Text(L10n.Action.close)
} }
} }
} }

View File

@@ -45,17 +45,17 @@ struct BrowseView: View {
if searchText.isEmpty, filteredApps.count == 0 { if searchText.isEmpty, filteredApps.count == 0 {
HintView { HintView {
Text("You don't have any apps yet.") Text(L10n.BrowseView.Hints.NoApps.title)
.bold() .bold()
Text("Apps are provided by \"sources\". The specification for them is an open standard, so everyone can create their own source. To get you started, we have compiled a list of \"Trusted Sources\" which you can check out by tapping the button below.") Text(L10n.BrowseView.Hints.NoApps.text)
.font(.callout) .font(.callout)
.foregroundColor(.secondary) .foregroundColor(.secondary)
SwiftUI.Button { SwiftUI.Button {
self.isShowingSourcesView = true self.isShowingSourcesView = true
} label: { } label: {
Label("Add Source", systemSymbol: .plus) Label(L10n.BrowseView.Hints.NoApps.addSource, systemSymbol: .plus)
} }
.buttonStyle(FilledButtonStyle()) .buttonStyle(FilledButtonStyle())
.padding(.top, 8) .padding(.top, 8)

View File

@@ -24,7 +24,7 @@ struct AppIDsView: View {
var body: some View { var body: some View {
ScrollView { ScrollView {
LazyVStack(alignment: .leading) { LazyVStack(alignment: .leading) {
Text("Each app and app extension installed with SideStore must register an App ID with Apple.\n\nApp IDs for paid developer accounts never expire, and there is no limit to how many you can create.") Text(L10n.AppIDsView.description)
.foregroundColor(.secondary) .foregroundColor(.secondary)
ForEach(appIDs, id: \.identifier) { appId in ForEach(appIDs, id: \.identifier) { appId in
@@ -42,10 +42,10 @@ struct AppIDsView: View {
} }
.padding() .padding()
} }
.navigationTitle("App IDs") .navigationTitle(L10n.AppIDsView.title)
.toolbar { .toolbar {
ToolbarItem(placement: .navigationBarTrailing) { ToolbarItem(placement: .confirmationAction) {
SwiftUI.Button("Done", action: self.dismiss) SwiftUI.Button(L10n.Action.done, action: self.dismiss)
} }
} }
} }

View File

@@ -157,7 +157,7 @@ struct MyAppsView: View {
var updatesSection: some View { var updatesSection: some View {
HintView { HintView {
HStack(alignment: .center) { HStack(alignment: .center) {
Text("All Apps are Up To Date") Text(L10n.MyAppsView.Hints.NoUpdates.title)
.bold() .bold()
Spacer() Spacer()
@@ -165,13 +165,13 @@ struct MyAppsView: View {
SwiftUI.Button { SwiftUI.Button {
self.dismissUpdatesHint(forever: false) self.dismissUpdatesHint(forever: false)
} label: { } label: {
Label("Dismiss for now", systemSymbol: .zzz) Label(L10n.MyAppsView.Hints.NoUpdates.dismissForNow, systemSymbol: .zzz)
} }
SwiftUI.Button { SwiftUI.Button {
self.dismissUpdatesHint(forever: true) self.dismissUpdatesHint(forever: true)
} label: { } label: {
Label("Don't show this again", systemSymbol: .xmark) Label(L10n.MyAppsView.Hints.NoUpdates.dontShowAgain, systemSymbol: .xmark)
} }
} label: { } label: {
Image(systemSymbol: .xmark) Image(systemSymbol: .xmark)
@@ -179,7 +179,7 @@ struct MyAppsView: View {
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
Text("You will be notified once updates for your apps are available. The updates will then be shown here.") Text(L10n.MyAppsView.Hints.NoUpdates.text)
.font(.callout) .font(.callout)
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }