Add es-419 and finish adding support for the translations

Added Latin American Spanish (probably not the best translation)

Made everything reference the swiftgen stuff rather than having strings
This commit is contained in:
bogotesr
2022-12-24 21:06:28 -07:00
committed by Joe Mattiello
parent 6257fdcd61
commit 2c07009b04
15 changed files with 499 additions and 81 deletions

View File

@@ -114,7 +114,7 @@ struct AppDetailView: View {
ExpandableText(text: storeApp.localizedDescription)
.lineLimit(6)
.expandButton(TextSet(text: "More...", font: .callout, color: .accentColor))
.expandButton(TextSet(text: L10n.AppDetailView.more, font: .callout, color: .accentColor))
.padding(.horizontal)
currentVersionView
@@ -158,11 +158,11 @@ struct AppDetailView: View {
VStack(alignment: .leading, spacing: 8) {
HStack(alignment: .bottom) {
VStack(alignment: .leading) {
Text("What's New")
Text(L10n.AppDetailView.whatsNew)
.bold()
.font(.title3)
Text("Version \(storeApp.version)")
Text("\(L10n.AppDetailView.version) \(storeApp.version)")
.font(.callout)
.foregroundColor(.secondary)
}
@@ -180,9 +180,9 @@ struct AppDetailView: View {
if let versionDescription = storeApp.versionDescription {
ExpandableText(text: versionDescription)
.lineLimit(5)
.expandButton(TextSet(text: "More...", font: .callout, color: .accentColor))
.expandButton(TextSet(text: L10n.AppDetailView.more, font: .callout, color: .accentColor))
} else {
Text("No version information")
Text(L10n.AppDetailView.noVersionInformation)
.foregroundColor(.secondary)
}
}
@@ -190,12 +190,12 @@ struct AppDetailView: View {
var permissionsView: some View {
VStack(alignment: .leading, spacing: 8) {
Text("Permissions")
Text(L10n.AppDetailView.permissions)
.bold()
.font(.title3)
if storeApp.permissions.isEmpty {
Text("The app requires no permissions.")
Text(L10n.AppDetailView.noPermissions)
.font(.callout)
.foregroundColor(.secondary)
} else {

View File

@@ -44,7 +44,7 @@ struct AppPermissionGridItemView: View {
.foregroundColor(.primary)
}
.alert(isPresented: self.$isPopoverPresented) {
Alert(title: Text("Usage Description"), message: Text(permission.usageDescription))
Alert(title: Text(L10n.AppPermissionGrid.usageDescription), message: Text(permission.usageDescription))
}
}
}

View File

@@ -23,15 +23,15 @@ struct AddSourceView: View {
.autocapitalization(.none)
.autocorrectionDisabled()
} header: {
Text("Source URL")
Text(L10n.AddSourceView.sourceURL)
} footer: {
VStack(alignment: .leading, spacing: 4) {
Text("Please enter the source url here. Then, tap continue to validate and add the source in the next step.")
Text(L10n.AddSourceView.sourceWarning)
HStack(alignment: .top) {
Image(systemSymbol: .exclamationmarkTriangleFill)
Text("Be careful with unvalidated third-party sources! Make sure to only add sources that you trust.")
Text(L10n.AddSourceView.sourceWarningContinued)
}
}
}
@@ -39,12 +39,12 @@ struct AddSourceView: View {
SwiftUI.Button {
self.continueHandler(self.sourceUrlText)
} label: {
Text("Continue")
Text(L10n.AddSourceView.continue)
}
.disabled(URL(string: self.sourceUrlText)?.host == nil)
}
.listStyle(InsetGroupedListStyle())
.navigationTitle("Add Source")
.navigationTitle(L10n.AddSourceView.title)
}
}

View File

@@ -131,7 +131,7 @@ struct PromotedCategoryView: View {
HStack {
Image(systemSymbol: .dpadRightFill)
Text("Games &\nEmulators")
Text(L10n.BrowseView.Categories.gamesAndEmulators)
.multilineTextAlignment(.leading)
}
.foregroundColor(.accentColor)

View File

@@ -25,7 +25,7 @@ struct ConfirmAddSourceView: View {
List {
Section {
VStack(alignment: .leading) {
Text("\(source.apps.count) Apps")
Text("\(source.apps.count) \(L10n.ConfirmAddSourceView.apps)")
Text(source.apps.map { $0.name }.joined(separator: ", "))
.font(.callout)
@@ -34,28 +34,28 @@ struct ConfirmAddSourceView: View {
}
VStack() {
Text("\(source.newsItems.count) News Items")
Text("\(source.newsItems.count) \(L10n.ConfirmAddSourceView.newsItems)")
}
} header: {
Text("Source Contents")
Text(L10n.ConfirmAddSourceView.sourceContents)
}
Section {
VStack(alignment: .leading) {
Text("Source Identifier")
Text(L10n.ConfirmAddSourceView.sourceIdentifier)
Text(source.identifier)
.font(.callout)
.foregroundColor(.secondary)
}
VStack(alignment: .leading) {
Text("Source URL")
Text(L10n.ConfirmAddSourceView.sourceURL)
Text(source.sourceURL.absoluteString)
.font(.callout)
.foregroundColor(.secondary)
}
} header: {
Text("Source Info")
Text(L10n.ConfirmAddSourceView.sourceInfo)
}
}
.listStyle(InsetGroupedListStyle())
@@ -65,7 +65,7 @@ struct ConfirmAddSourceView: View {
SwiftUI.Button {
confirmationHandler(fetchedSource)
} label: {
Label("Add Source", systemSymbol: .plus)
Label(L10n.ConfirmAddSourceView.addSource, systemSymbol: .plus)
}
.buttonStyle(FilledButtonStyle())
.padding()

View File

@@ -35,7 +35,7 @@ struct SourcesView: View {
LazyVStack(alignment: .leading, spacing: 24) {
// Installed Sources
LazyVStack(alignment: .leading, spacing: 12) {
Text("Sources control what apps are available to download through SideStore.")
Text(L10n.SourcesView.sourcesDescription)
.font(.callout)
.foregroundColor(.secondary)
@@ -58,7 +58,7 @@ struct SourcesView: View {
SwiftUI.Button {
self.removeSource(source)
} label: {
Label("Remove", systemSymbol: .trash)
Label(L10n.SourcesView.remove, systemSymbol: .trash)
}
}))
}
@@ -67,11 +67,11 @@ struct SourcesView: View {
// Trusted Sources
LazyVStack(alignment: .leading) {
Text("Trusted Sources")
Text(L10n.SourcesView.trustedSources)
.font(.title3)
.bold()
Text("SideStore has reviewed these sources to make sure they meet our safety standards.")
Text(L10n.SourcesView.reviewedText)
.font(.callout)
.foregroundColor(.secondary)
@@ -80,7 +80,7 @@ struct SourcesView: View {
}
.padding()
}
.navigationTitle("Sources")
.navigationTitle(L10n.SourcesView.sources)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
SwiftUI.Button {
@@ -107,7 +107,7 @@ struct SourcesView: View {
ToolbarItem(placement: .navigationBarTrailing) {
SwiftUI.Button(action: self.dismiss) {
Text("Done").bold()
Text(L10n.SourcesView.done).bold()
}
}
}

View File

@@ -20,18 +20,18 @@ enum AppAction: Int, CaseIterable {
var title: String {
switch self {
case .install: return "Install"
case .open: return "Open"
case .refresh: return "Refresh"
case .activate: return "Activate"
case .deactivate: return "Deactivate"
case .remove: return "Remove"
case .enableJIT: return "Enable JIT"
case .backup: return "Back Up"
case .exportBackup: return "Export Backup"
case .restoreBackup: return "Restore Backup"
case .chooseCustomIcon: return "Change Icon"
case .resetCustomIcon: return "Reset Icon"
case .install: return L10n.AppAction.install
case .open: return L10n.AppAction.open
case .refresh: return L10n.AppAction.refresh
case .activate: return L10n.AppAction.activate
case .deactivate: return L10n.AppAction.deactivate
case .remove: return L10n.AppAction.remove
case .enableJIT: return L10n.AppAction.enableJIT
case .backup: return L10n.AppAction.backup
case .exportBackup: return L10n.AppAction.exportBackup
case .restoreBackup: return L10n.AppAction.restoreBackup
case .chooseCustomIcon: return L10n.AppAction.chooseCustomIcon
case .resetCustomIcon: return L10n.AppAction.resetIcon
}
}

View File

@@ -68,7 +68,7 @@ struct MyAppsView: View {
LazyVStack(spacing: 16) {
if let progress = SideloadingManager.shared.progress {
VStack {
Text("Sideloading in progress...")
Text(L10n.MyAppsView.sideloading)
.padding()
ProgressView(progress)
@@ -84,14 +84,14 @@ struct MyAppsView: View {
}
HStack {
Text("Active")
Text(L10n.MyAppsView.active)
.font(.title2)
.bold()
Spacer()
SwiftUI.Button {
} label: {
Text("Refresh All")
Text(L10n.MyAppsView.refreshAll)
}
}
@@ -111,14 +111,14 @@ struct MyAppsView: View {
VStack {
if DatabaseManager.shared.activeTeam()?.type == .free {
Text("\(remainingAppIDs) App IDs Remaining")
Text("\(remainingAppIDs) \(L10n.MyAppsView.appIDsRemaining)")
.foregroundColor(.secondary)
}
SwiftUI.Button {
self.isShowingAppIDsView = true
} label: {
Text("View App IDs")
Text(L10n.MyAppsView.viewAppIDs)
}
.sheet(isPresented: self.$isShowingAppIDsView) {
NavigationView {
@@ -130,7 +130,7 @@ struct MyAppsView: View {
.padding(.horizontal)
}
.background(Color(UIColor.systemGroupedBackground).ignoresSafeArea())
.navigationTitle("My Apps")
.navigationTitle(L10n.MyAppsView.myApps)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
SwiftUI.Button {
@@ -239,7 +239,7 @@ extension MyAppsView {
NotificationManager.shared.reportError(error: failure.value)
} else {
// TODO: Localize
let title = "Failed to refresh \(failures.count) apps."
let title = "\(L10n.MyAppsView.failedToRefresh) \(failures.count) \(L10n.MyAppsView.apps)"
let error = failures.first?.value as NSError?
let message = error?.localizedFailure ?? error?.localizedFailureReason ?? error?.localizedDescription

View File

@@ -90,10 +90,10 @@ extension RootView {
var displayName: String {
switch self {
case .news: return "News"
case .browse: return "Browse"
case .myApps: return "My Apps"
case .settings: return "Settings"
case .news: return L10n.RootView.news
case .browse: return L10n.RootView.browse
case .myApps: return L10n.RootView.myApps
case .settings: return L10n.RootView.settings
}
}

View File

@@ -30,16 +30,16 @@ struct ConnectAppleIDView: View {
var body: some View {
ScrollView {
VStack(alignment: .leading, spacing: 32) {
Text("Sign in with your Apple ID to get started.")
Text(L10n.ConnectAppleIDView.startWithSignIn)
VStack(spacing: 16) {
RoundedTextField(title: "Apple ID", placeholder: "user@sidestore.io", text: $email)
RoundedTextField(title: L10n.ConnectAppleIDView.appleID, placeholder: "user@sidestore.io", text: $email)
RoundedTextField(title: "Password", placeholder: "••••••", text: $password, isSecure: true)
RoundedTextField(title: L10n.ConnectAppleIDView.password, placeholder: "••••••", text: $password, isSecure: true)
}
SwiftUI.Button(action: signIn) {
Text("Sign in")
Text(L10n.ConnectAppleIDView.signIn)
.bold()
}
.buttonStyle(FilledButtonStyle(isLoading: isLoading))
@@ -48,10 +48,10 @@ struct ConnectAppleIDView: View {
Spacer()
VStack(alignment: .leading) {
Text("Why do we need this?")
Text(L10n.ConnectAppleIDView.whyDoWeNeedThis)
.bold()
Text("Your Apple ID is used to configure apps so they can be installed on this device. Your credentials will be stored securely in this device's Keychain and sent only to Apple for authentication.")
Text(L10n.ConnectAppleIDView.footer)
}
.padding()
.background(
@@ -62,11 +62,11 @@ struct ConnectAppleIDView: View {
.padding(.horizontal)
}
.frame(maxWidth: .infinity)
.navigationTitle("Connect your Apple ID")
.navigationTitle(L10n.ConnectAppleIDView.connectYourAppleID)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
SwiftUI.Button(action: self.cancel) {
Text("Cancel")
Text(L10n.ConnectAppleIDView.cancel)
}
}
}
@@ -87,7 +87,7 @@ struct ConnectAppleIDView: View {
break
case .failure(let error as NSError):
let error = error.withLocalizedFailure(NSLocalizedString("Failed to Log In", comment: ""))
let error = error.withLocalizedFailure(NSLocalizedString(L10n.ConnectAppleIDView.failedToSignIn, comment: ""))
print(error)
case .success((let account, let session)):

View File

@@ -36,21 +36,21 @@ struct SettingsView: View {
if let connectedAppleID = connectedTeams.first {
HStack {
Text("Name")
Text(L10n.SettingsView.ConnectedAppleID.name)
.foregroundColor(.secondary)
Spacer()
Text(connectedAppleID.name)
}
HStack {
Text("E-Mail")
Text(L10n.SettingsView.ConnectedAppleID.eMail)
.foregroundColor(.secondary)
Spacer()
Text(connectedAppleID.account.appleID)
}
HStack {
Text("Type")
Text(L10n.SettingsView.ConnectedAppleID.type)
.foregroundColor(.secondary)
Spacer()
Text(connectedAppleID.type.localizedDescription)
@@ -59,18 +59,18 @@ struct SettingsView: View {
SwiftUI.Button {
self.connectAppleID()
} label: {
Text("Connect your Apple ID")
Text(L10n.SettingsView.connectAppleID)
}
}
} header: {
if !connectedTeams.isEmpty {
HStack {
Text("Connected Apple ID")
Text(L10n.SettingsView.ConnectedAppleID.text)
Spacer()
SwiftUI.Button {
self.disconnectAppleID()
} label: {
Text("Sign Out")
Text(L10n.SettingsView.ConnectedAppleID.signOut)
.font(.callout)
.bold()
}
@@ -78,21 +78,21 @@ struct SettingsView: View {
}
} footer: {
VStack(spacing: 4) {
Text("Your Apple ID is required to sign the apps you install with SideStore.")
Text(L10n.SettingsView.ConnectedAppleID.Footer.p1)
Text("Your credentials are only sent to Apple's servers and are not accessible by the SideStore Team. Once successfully logged in, the login details are stored securely on your device.")
Text(L10n.SettingsView.ConnectedAppleID.Footer.p2)
}
}
Section {
Toggle(isOn: self.$isBackgroundRefreshEnabled, label: {
Text("Background Refresh")
Text(L10n.SettingsView.backgroundRefresh)
})
SwiftUI.Button {
self.isShowingAddShortcutView = true
} label: {
Text("Add to Siri...")
Text(L10n.SettingsView.addToSiri)
}
.sheet(isPresented: self.$isShowingAddShortcutView) {
if let shortcut = INShortcut(intent: INInteraction.refreshAllApps().intent) {
@@ -100,22 +100,22 @@ struct SettingsView: View {
}
}
} header: {
Text("Refreshing Apps")
Text(L10n.SettingsView.refreshingApps)
} footer: {
Text("Enable Background Refresh to automatically refresh apps in the background when connected to WiFi and with Wireguard active.")
Text(L10n.SettingsView.refreshingAppsFooter)
}
Section {
SwiftUI.Button(action: switchToUIKit) {
Text("Switch to UIKit")
Text(L10n.SettingsView.switchToUIKit)
}
SwiftUI.Button(action: resetImageCache) {
Text("Reset Image Cache")
Text(L10n.SettingsView.resetImageCache)
}
} header: {
Text("Debug")
Text(L10n.SettingsView.debug)
}
@@ -124,7 +124,7 @@ struct SettingsView: View {
SafariView(url: URL(string: "https://fabian-thies.de")!)
} label: {
HStack {
Text("SwiftUI Redesign")
Text(L10n.SettingsView.swiftUIRedesign)
.foregroundColor(.secondary)
Spacer()
Text("fabianthdev")
@@ -132,7 +132,7 @@ struct SettingsView: View {
}
} header: {
Text("Credits")
Text(L10n.SettingsView.credits)
}
Section {
@@ -144,7 +144,7 @@ struct SettingsView: View {
}
}
.listStyle(InsetGroupedListStyle())
.navigationTitle("Settings")
.navigationTitle(L10n.SettingsView.title)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
SwiftUI.Button {