Skip to content

Commit 83e4cfb

Browse files
committed
Bumped translation to 3.1.2, Changed code localized format to desired ones
1 parent 892055f commit 83e4cfb

8 files changed

Lines changed: 573 additions & 97 deletions

File tree

StikJIT/Assets.xcassets/Localizable.xcstrings

Lines changed: 500 additions & 24 deletions
Large diffs are not rendered by default.

StikJIT/Utilities/DeviceInfoManager.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ struct DeviceInfoView: View {
164164
List {
165165
if !isPaired {
166166
Section {
167-
Label("No pairing file detected", systemImage: "exclamationmark.triangle.fill")
167+
Label(String(format: "No pairing file detected".localized), systemImage: "exclamationmark.triangle.fill")
168168
.foregroundStyle(.orange)
169169
Text("Import your device's pairing file to get started.")
170170
.font(.footnote)
@@ -186,10 +186,10 @@ struct DeviceInfoView: View {
186186
.padding(.vertical, 2)
187187
.contextMenu {
188188
Button { copyToPasteboard(entry.value) } label: {
189-
Label("Copy Value", systemImage: "doc.on.doc")
189+
Label(String(format: "Copy Value".localized), systemImage: "doc.on.doc")
190190
}
191191
Button { copyToPasteboard("\(entry.key): \(entry.value)") } label: {
192-
Label("Copy Key & Value", systemImage: "doc.on.clipboard")
192+
Label(String(format: "Copy Key & Value".localized), systemImage: "doc.on.clipboard")
193193
}
194194
}
195195
}
@@ -210,7 +210,7 @@ struct DeviceInfoView: View {
210210
.overlay {
211211
if mgr.busy {
212212
Color.black.opacity(0.35).ignoresSafeArea()
213-
ProgressView("Fetching device info…")
213+
ProgressView(String(format: "Fetching device info…".localized))
214214
.padding(16)
215215
.background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16, style: .continuous))
216216
}
@@ -236,7 +236,7 @@ struct DeviceInfoView: View {
236236
ToolbarItemGroup(placement: .navigationBarTrailing) {
237237
if isPaired {
238238
Button { mgr.initAndLoad() } label: {
239-
Label("Reload", systemImage: "arrow.clockwise")
239+
Label(String(format: "Reload".localized), systemImage: "arrow.clockwise")
240240
}
241241

242242
Button {
@@ -247,19 +247,19 @@ struct DeviceInfoView: View {
247247
fail("Export Failed", error.localizedDescription)
248248
}
249249
} label: {
250-
Label("Export", systemImage: "square.and.arrow.up")
250+
Label(String(format: "Export".localized), systemImage: "square.and.arrow.up")
251251
}
252252
.disabled(mgr.entries.isEmpty)
253253

254254
Menu {
255255
Button { copyAllText() } label: {
256-
Label(NSLocalizedString("Copy All (Text)", comment: ""), systemImage: "doc.on.doc")
256+
Label(String(format: "Copy All (Text)".localized), systemImage: "doc.on.doc")
257257
}
258258
Button { copyAllCSV() } label: {
259-
Label(NSLocalizedString("Copy All (CSV)", comment: ""), systemImage: "tablecells")
259+
Label(String(format: "Copy All (CSV)".localized), systemImage: "tablecells")
260260
}
261261
Button { shareAll() } label: {
262-
Label(NSLocalizedString("Share…", comment: ""), systemImage: "square.and.arrow.up.on.square")
262+
Label(String(format: "Share…".localized), systemImage: "square.and.arrow.up.on.square")
263263
}
264264
} label: {
265265
Image(systemName: "ellipsis.circle")
@@ -270,7 +270,7 @@ struct DeviceInfoView: View {
270270
ToolbarItem(placement: .navigationBarLeading) {
271271
if !isPaired {
272272
Button { importer = true } label: {
273-
Label("Import Pairing File", systemImage: "doc.badge.plus")
273+
Label(String(format: "Import Pairing File".localized), systemImage: "doc.badge.plus")
274274
}
275275
}
276276
}

StikJIT/Views/ConsoleLogsView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,9 @@ struct ConsoleLogsView: View {
534534

535535
private var syslogControlLabel: String {
536536
if !systemLogStream.isStreaming {
537-
return NSLocalizedString("Start syslog relay", comment: "")
537+
return String(format: "Start syslog relay".localized)
538538
}
539-
return systemLogStream.isPaused ? NSLocalizedString("Resume syslog stream", comment: "") : NSLocalizedString("Pause syslog stream", comment: "")
539+
return systemLogStream.isPaused ? String(format: "Resume syslog stream".localized) : String(format: "Pause syslog stream".localized)
540540
}
541541

542542
private func presentAlert(title: String, message: String) {

StikJIT/Views/MainTabView.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ struct MainTabView: View {
2727

2828
private var configurableTabs: [TabDescriptor] {
2929
let tabs: [TabDescriptor] = [
30-
TabDescriptor(id: "home", title: NSLocalizedString("Apps", comment: ""), systemImage: "square.grid.2x2") { AnyView(HomeView()) },
31-
TabDescriptor(id: "scripts", title: NSLocalizedString("Scripts", comment: ""), systemImage: "scroll") { AnyView(ScriptListView()) },
32-
TabDescriptor(id: "tools", title: NSLocalizedString("Tools", comment: ""), systemImage: "wrench.and.screwdriver") { AnyView(ToolsView()) },
33-
TabDescriptor(id: "deviceinfo", title: NSLocalizedString("Device Info", comment: ""), systemImage: "iphone.and.arrow.forward") { AnyView(DeviceInfoView()) },
34-
TabDescriptor(id: "profiles", title: NSLocalizedString("App Expiry", comment: ""), systemImage: "calendar.badge.clock") { AnyView(ProfileView()) },
35-
TabDescriptor(id: "processes", title: NSLocalizedString("Processes", comment: ""), systemImage: "rectangle.stack.person.crop") { AnyView(ProcessInspectorView()) },
36-
TabDescriptor(id: "location", title: NSLocalizedString("Location", comment: ""), systemImage: "location") { AnyView(LocationSimulationView()) }
30+
TabDescriptor(id: "home", title: String(format: "Apps".localized), systemImage: "square.grid.2x2") { AnyView(HomeView()) },
31+
TabDescriptor(id: "scripts", title: String(format: "Scripts".localized), systemImage: "scroll") { AnyView(ScriptListView()) },
32+
TabDescriptor(id: "tools", title: String(format: "Tools".localized), systemImage: "wrench.and.screwdriver") { AnyView(ToolsView()) },
33+
TabDescriptor(id: "deviceinfo", title: String(format: "Device Info".localized), systemImage: "iphone.and.arrow.forward") { AnyView(DeviceInfoView()) },
34+
TabDescriptor(id: "profiles", title: String(format: "App Expiry".localized), systemImage: "calendar.badge.clock") { AnyView(ProfileView()) },
35+
TabDescriptor(id: "processes", title: String(format: "Processes".localized), systemImage: "rectangle.stack.person.crop") { AnyView(ProcessInspectorView()) },
36+
TabDescriptor(id: "location", title: String(format: "Location".localized), systemImage: "location") { AnyView(LocationSimulationView()) }
3737
]
3838
return tabs
3939
}
@@ -42,7 +42,7 @@ struct MainTabView: View {
4242
configurableTabs
4343
}
4444

45-
private let settingsTab = TabDescriptor(id: "settings", title: NSLocalizedString("Settings", comment: ""), systemImage: "gearshape.fill") {
45+
private let settingsTab = TabDescriptor(id: "settings", title: String(format: "Settings".localized), systemImage: "gearshape.fill") {
4646
AnyView(SettingsView())
4747
}
4848

StikJIT/Views/MapSelectionView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,9 @@ struct LocationSimulationView: View {
804804
private func simulate() {
805805
guard pairingExists, let coord = coordinate, !isBusy else { return }
806806
runLocationCommand(
807-
errorTitle: NSLocalizedString("Simulation Failed", comment: ""),
807+
errorTitle: String(format: "Simulation Failed".localized),
808808
errorMessage: { code in
809-
String(format: NSLocalizedString("Could not simulate location (error %d). Make sure the device is connected and the DDI is mounted.", comment: ""), code)
809+
String(format: "Could not simulate location (error %d). Make sure the device is connected and the DDI is mounted.".localized, code)
810810
},
811811
operation: { locationUpdateCode(for: coord) }
812812
) {
@@ -827,9 +827,9 @@ struct LocationSimulationView: View {
827827
stopResendLoop()
828828
cancelRoutePlayback(resetMarker: false)
829829
runLocationCommand(
830-
errorTitle: NSLocalizedString("Route Simulation Failed", comment: ""),
830+
errorTitle: String(format: "Route Simulation Failed".localized),
831831
errorMessage: { code in
832-
String(format: NSLocalizedString("Could not start route simulation (error %d). Make sure the device is connected and the DDI is mounted.", comment: ""), code)
832+
String(format: "Could not start route simulation (error %d). Make sure the device is connected and the DDI is mounted.".localized, code)
833833
},
834834
operation: { locationUpdateCode(for: firstCoordinate) }
835835
) {
@@ -1137,7 +1137,7 @@ private struct RouteSearchSheet: View {
11371137
NavigationStack {
11381138
VStack(alignment: .leading, spacing: 16) {
11391139
routeField(
1140-
title: NSLocalizedString("Start", comment: ""),
1140+
title: String(format: "Start".localized),
11411141
icon: "circle.fill",
11421142
tint: .green,
11431143
text: $startQuery,
@@ -1146,7 +1146,7 @@ private struct RouteSearchSheet: View {
11461146
)
11471147

11481148
routeField(
1149-
title: NSLocalizedString("End", comment: ""),
1149+
title: String(format: "End".localized),
11501150
icon: "flag.checkered.circle.fill",
11511151
tint: .red,
11521152
text: $endQuery,

StikJIT/Views/ProfileView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ struct ProfileView: View {
158158
if let match = entry.bestMatchingProfile {
159159
HStack {
160160
Image(systemName: "clock")
161-
Text(String(format: NSLocalizedString("Expires: %@", comment: ""), match.profile.formattedDate))
161+
Text(String(format: "Expires: %@".localized, match.profile.formattedDate))
162162
}
163163
.foregroundStyle(match.profile.dateColor)
164164
.font(.subheadline)
@@ -203,7 +203,7 @@ struct ProfileView: View {
203203
else { expandedApps.insert(entry.id) }
204204
}
205205
} label: {
206-
Label(showMore ? NSLocalizedString("Hide older profiles", comment: "") : String(format: NSLocalizedString("Show %d older profiles", comment: ""), extraProfiles.count),
206+
Label(showMore ? String(format: "Hide older profiles".localized) : String(format: "Show %d older profiles".localized, extraProfiles.count),
207207
systemImage: showMore ? "chevron.up" : "chevron.down")
208208
.font(.caption)
209209
.foregroundStyle(.blue)
@@ -282,7 +282,7 @@ struct ProfileView: View {
282282
}
283283
Button("Cancel", role: .cancel) { }
284284
} message: {
285-
Text("Remove profile for \(removeTargetName) (UUID: \(removeTargetUUID))?\nApps associated with this profile may become unavailable.")
285+
Text(String(format: "Remove profile for %@ (UUID: %@)?\nApps associated with this profile may become unavailable.".localized, removeTargetName, removeTargetUUID))
286286
}
287287
}
288288

0 commit comments

Comments
 (0)