-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(i18n): add localization support using NSLocalizedString for previously hardcoded strings #7653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ struct VMConfigNetworkView: View { | |
| } | ||
| } | ||
| if config.mode == .host { | ||
| Picker("Host Network", selection: $config.hostNetUuid) { | ||
| Picker(NSLocalizedString("Host Network", comment: "VMConfigNetworkView"), selection: $config.hostNetUuid) { | ||
| Text("Default (private)") | ||
| .tag(nil as String?) | ||
|
Comment on lines
+50
to
52
|
||
| ForEach(hostNetworks) { interface in | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -375,14 +375,14 @@ struct Details: View { | |
| } | ||
| ForEach(network.currentIpAddresses) { guestIP in | ||
| HStack { | ||
| plainLabel("Guest IP", systemImage: "network.badge.shield.half.filled") | ||
| plainLabel(LocalizedStringKey(NSLocalizedString("Guest IP", comment: "VMDetailsView")), systemImage: "network.badge.shield.half.filled") | ||
|
||
| Spacer() | ||
| OptionalSelectableText(guestIP) | ||
| } | ||
| } | ||
| if network.mode == .bridged, let interface = network.bridgeInterface { | ||
| HStack { | ||
| plainLabel("Bridge Interface", systemImage: "arrow.triangle.branch") | ||
| plainLabel(LocalizedStringKey(NSLocalizedString("Bridge Interface", comment: "VMDetailsView")), systemImage: "arrow.triangle.branch") | ||
| Spacer() | ||
| Text(interface) | ||
| .foregroundColor(.secondary) | ||
|
|
@@ -405,7 +405,7 @@ struct Details: View { | |
| ForEach(appleConfig.serials) { serial in | ||
| if serial.mode == .ptty { | ||
| HStack { | ||
| plainLabel("Serial (TTY)", systemImage: "phone.connection") | ||
| plainLabel(LocalizedStringKey(NSLocalizedString("Serial (TTY)", comment: "VMDetailsView")), systemImage: "phone.connection") | ||
| Spacer() | ||
| OptionalSelectableText(serial.interface?.name) | ||
| } | ||
|
|
@@ -417,14 +417,14 @@ struct Details: View { | |
| ForEach(qemuConfig.serials) { serial in | ||
| if serial.mode == .tcpClient { | ||
| HStack { | ||
| plainLabel("Serial (Client)", systemImage: "network") | ||
| plainLabel(LocalizedStringKey(NSLocalizedString("Serial (Client)", comment: "VMDetailsView")), systemImage: "network") | ||
| Spacer() | ||
| let address = "\(serial.tcpHostAddress ?? "example.com"):\(serial.tcpPort ?? 1234)" | ||
| OptionalSelectableText(vm.state == .started ? address : nil) | ||
| } | ||
| } else if serial.mode == .tcpServer { | ||
| HStack { | ||
| plainLabel("Serial (Server)", systemImage: "network") | ||
| plainLabel(LocalizedStringKey(NSLocalizedString("Serial (Server)", comment: "VMDetailsView")), systemImage: "network") | ||
| Spacer() | ||
| let address = "\(serial.tcpPort ?? 1234)" | ||
| OptionalSelectableText(vm.state == .started ? address : nil) | ||
|
|
@@ -433,7 +433,7 @@ struct Details: View { | |
| #if os(macOS) | ||
| if serial.mode == .ptty { | ||
| HStack { | ||
| plainLabel("Serial (TTY)", systemImage: "phone.connection") | ||
| plainLabel(LocalizedStringKey(NSLocalizedString("Serial (TTY)", comment: "VMDetailsView")), systemImage: "phone.connection") | ||
| Spacer() | ||
| OptionalSelectableText(serial.pttyDevice?.path) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alert titles were localized, but the destructive button labels (
"Reclaim"/"Resize") are still hardcoded, so the user-facing alert remains partially untranslated. Consider localizing these button titles as well (and ensure the button label matches the action for the.compresscase if the copy is intended to differ).