Skip to content

Commit

Permalink
Merge pull request #4514 from conath/dev-german
Browse files Browse the repository at this point in the history
Add German localization
  • Loading branch information
osy authored Oct 19, 2022
2 parents 35a0748 + a1fbb7a commit 135874c
Show file tree
Hide file tree
Showing 14 changed files with 1,569 additions and 14 deletions.
23 changes: 16 additions & 7 deletions Platform/Shared/VMConfigInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@
import SwiftUI

private enum IconStyle: String, Identifiable, CaseIterable {
case generic = "Generic"
case operatingSystem = "Operating System"
case custom = "Custom"
case generic
case operatingSystem
case custom

var localizedName: LocalizedStringKey { LocalizedStringKey(rawValue) }
var id: String { rawValue }
var text: Text {
get {
switch self {
case .generic: return Text("Generic");
case .operatingSystem: return Text("Operating System")
case .custom: return Text("Custom")
}
}
}

var id: String { get { self.rawValue } }
}

struct VMConfigInfoView: View {
Expand Down Expand Up @@ -97,8 +106,8 @@ struct VMConfigInfoView: View {
}

Picker(selection: style.animation(), label: Text("Style")) {
ForEach(IconStyle.allCases, id: \.id) { value in
Text(value.localizedName)
ForEach(IconStyle.allCases, id: \.rawValue) { value in
value.text
.tag(value)
}
}
Expand Down
25 changes: 18 additions & 7 deletions Platform/Shared/VMPlaceholderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,45 @@ struct VMPlaceholderView: View {
Text("Welcome to UTM").font(.title)
}
HStack {
TileButton(titleKey: "Create a New Virtual Machine", systemImage: "plus.circle") {
TileButton(Label(String.create, systemImage: "plus.circle")) {
data.newVM()
}
TileButton(titleKey: "Browse UTM Gallery", systemImage: "arrow.down.circle") {
TileButton(Label(String.browse, systemImage: "arrow.down.circle")) {
openURL(URL(string: "https://mac.getutm.app/gallery/")!)
}
}
HStack {
/// Link to Mac sites on all platforms because they are more up to date
TileButton(titleKey: "User Guide", systemImage: "book.circle") {
TileButton(Label(String.guide, systemImage: "book.circle")) {
openURL(URL(string: "https://mac.getutm.app/guide/")!)
}
TileButton(titleKey: "Support", systemImage: "questionmark.circle") {
TileButton(Label(String.support, systemImage: "questionmark.circle")) {
openURL(URL(string: "https://docs.getutm.app/")!)
}
}
}
}
}

fileprivate extension String {
static let create = NSLocalizedString("Create a New Virtual Machine", comment: "Welcome view")
static let browse = NSLocalizedString("Browse UTM Gallery", comment: "Welcome view")
static let guide = NSLocalizedString("User Guide", comment: "Welcome view")
static let support = NSLocalizedString("Support", comment: "Welcome view")
}

private struct TileButton: View {
let titleKey: LocalizedStringKey
let systemImage: String
let label: Label<Text, Image>
let action: () -> Void

init(_ label: Label<Text, Image>, action: @escaping () -> Void) {
self.label = label
self.action = action
}

var body: some View {
Button(action: action, label: {
Label(titleKey, systemImage: systemImage)
label
.labelStyle(TileLabelStyle())
}).buttonStyle(BigButtonStyle(width: 150, height: 150))
}
Expand Down
14 changes: 14 additions & 0 deletions Platform/de.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* Privacy - Location Always and When In Use Usage Description */
"NSLocationAlwaysAndWhenInUseUsageDescription" = "UTM verwendet den Ortungs-Zugriff nur, um die App im Hintergrund weiter auszuführen. Die Ortungsdaten werden nicht verwendet.";

/* Privacy - Location Always Usage Description */
"NSLocationAlwaysUsageDescription" = "UTM verwendet den Ortungs-Zugriff nur, um die App im Hintergrund weiter auszuführen. Die Ortungsdaten werden nicht verwendet.";

/* Privacy - Location When In Use Usage Description */
"NSLocationWhenInUseUsageDescription" = "UTM verwendet den Ortungs-Zugriff nur, um die App im Hintergrund weiter auszuführen. Die Ortungsdaten werden nicht verwendet.";

/* Privacy - Microphone Usage Description */
"NSMicrophoneUsageDescription" = "Für Mikrofonzugriff in der VM wird Ihre Erlaubnis benötigt.";

/* (No Comment) */
"UTM virtual machine" = "Virtuelle Maschine (UTM)";
Loading

0 comments on commit 135874c

Please sign in to comment.