Skip to content

Commit a804c80

Browse files
authored
Merge pull request #49 from friendlytsy/russian-localization
Russian localization
2 parents 4abd511 + f3f7f75 commit a804c80

38 files changed

Lines changed: 562 additions & 138 deletions

InfiniLink.xcodeproj/project.pbxproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
26D7817026CA004B00BBF555 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26D7816F26CA004B00BBF555 /* SettingsView.swift */; };
8585
26D7817A26CAD19F00BBF555 /* ColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26D7817926CAD19F00BBF555 /* ColorPalette.swift */; };
8686
26F426EF26C72D7D00D0866B /* ChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26F426EE26C72D7D00D0866B /* ChartView.swift */; };
87+
F9A88B642765357600B2B94C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F9A88B662765357600B2B94C /* Localizable.strings */; };
8788
/* End PBXBuildFile section */
8889

8990
/* Begin PBXContainerItemProxy section */
@@ -186,6 +187,8 @@
186187
26D7816F26CA004B00BBF555 /* SettingsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
187188
26D7817926CAD19F00BBF555 /* ColorPalette.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorPalette.swift; sourceTree = "<group>"; };
188189
26F426EE26C72D7D00D0866B /* ChartView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChartView.swift; sourceTree = "<group>"; };
190+
F99B8DCC276778FF0096A84D /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
191+
F9A88B652765357600B2B94C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
189192
/* End PBXFileReference section */
190193

191194
/* Begin PBXFrameworksBuildPhase section */
@@ -319,6 +322,7 @@
319322
264BFE4F26BC51CF0050A223 /* Info.plist */,
320323
2601AF612721D0BF00D999EF /* InfiniLink.xcdatamodeld */,
321324
264BFE4726BC51CF0050A223 /* Preview Content */,
325+
F9A88B662765357600B2B94C /* Localizable.strings */,
322326
);
323327
path = InfiniLink;
324328
sourceTree = "<group>";
@@ -584,6 +588,7 @@
584588
knownRegions = (
585589
en,
586590
Base,
591+
ru,
587592
);
588593
mainGroup = 264BFE3526BC51CE0050A223;
589594
packageReferences = (
@@ -607,6 +612,7 @@
607612
buildActionMask = 2147483647;
608613
files = (
609614
264BFE7826BCAAC00050A223 /* README.md in Resources */,
615+
F9A88B642765357600B2B94C /* Localizable.strings in Resources */,
610616
264BFE4926BC51CF0050A223 /* Preview Assets.xcassets in Resources */,
611617
264BFE4626BC51CF0050A223 /* Assets.xcassets in Resources */,
612618
);
@@ -737,6 +743,18 @@
737743
};
738744
/* End PBXTargetDependency section */
739745

746+
/* Begin PBXVariantGroup section */
747+
F9A88B662765357600B2B94C /* Localizable.strings */ = {
748+
isa = PBXVariantGroup;
749+
children = (
750+
F9A88B652765357600B2B94C /* en */,
751+
F99B8DCC276778FF0096A84D /* ru */,
752+
);
753+
name = Localizable.strings;
754+
sourceTree = "<group>";
755+
};
756+
/* End PBXVariantGroup section */
757+
740758
/* Begin XCBuildConfiguration section */
741759
264BFE6626BC51CF0050A223 /* Debug */ = {
742760
isa = XCBuildConfiguration;

InfiniLink/ContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct ContentView: View {
8585
})
8686
// alert to handle errors thrown by SetTime
8787
.alert(isPresented: $bleManager.setTimeError, content: {
88-
Alert(title: Text("Failed to Set Time"), message: Text("There was an issue setting the time on your watch. Please disconnect from the watch, and then reconnect."), dismissButton: .default(Text("Dismiss")))
88+
Alert(title: Text(NSLocalizedString("failed_set_time", comment: "")), message: Text(NSLocalizedString("failed_set_time_description", comment: "")), dismissButton: .default(Text(NSLocalizedString("dismiss", comment: ""))))
8989
})
9090

9191
.onAppear(){

InfiniLink/Music/MusicController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class MusicController {
8181

8282
func getCurrentSongInfo() -> songInfo {
8383
let currentTrack = musicPlayer.nowPlayingItem
84-
let currentSongInfo = songInfo(trackName: currentTrack?.title ?? "Not Playing", artistName: currentTrack?.artist ?? "Not Playing")
84+
let currentSongInfo = songInfo(trackName: currentTrack?.title ?? NSLocalizedString("not_playing", comment: ""), artistName: currentTrack?.artist ?? NSLocalizedString("not_playing", comment: ""))
8585
return currentSongInfo
8686
}
8787

InfiniLink/Settings/SettingsFunctions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class BatteryNotifications: ObservableObject {
2121
twenty = false
2222
ten = false
2323
} else if (bat <= 20 && bat > 10) && twenty == false {
24-
bleWriteManger.sendNotification(title: "", body: "Battery Low")
24+
bleWriteManger.sendNotification(title: "", body: NSLocalizedString("battery_low", comment: ""))
2525
twenty = true
2626
} else if (bat <= 10 && bat > 5) && ten == false {
27-
bleWriteManger.sendNotification(title: "", body: "Battery Low")
27+
bleWriteManger.sendNotification(title: "", body: NSLocalizedString("battery_low", comment: ""))
2828
ten = true
2929
}
3030
}

InfiniLink/View Components/Chart View Components/BatteryChart.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct BatteryChart: View {
5454
VStack (alignment: .center) {
5555
Spacer()
5656
HStack (alignment: .center) {
57-
Text("Insufficient Battery Data")
57+
Text(NSLocalizedString("insufficient_battery_data", comment: ""))
5858
.font(.title)
5959
}
6060
Spacer()

InfiniLink/View Components/Chart View Components/ChartTabs.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ struct StatusTabs: View {
1919

2020
var body: some View{
2121
Picker("Chart", selection: $chartManager.currentChart) {
22-
Text("Heart: " + String(format: "%.0f", bleManager.heartBPM) + " BPM")
22+
Text(NSLocalizedString("heart", comment: "") + String(format: "%.0f", bleManager.heartBPM) + " \(NSLocalizedString("bpm", comment: ""))")
2323
.tag(ChartManager.chartSelection.heart)
24-
Text("Battery: " + String(format: "%.0f", bleManager.batteryLevel) + "%")
24+
Text(NSLocalizedString("battery", comment: "") + String(format: "%.0f", bleManager.batteryLevel) + "%")
2525
.tag(ChartManager.chartSelection.battery)
2626
}
2727
.pickerStyle(.segmented)

InfiniLink/View Components/Chart View Components/HeartChart.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ struct HeartChart: View {
5151
setGraphType(data: data)
5252
.animation(.easeIn)
5353
.floatingInfoBox(chartData: data)
54-
.touchOverlay(chartData: data, unit: .suffix(of: "BPM"))
54+
.touchOverlay(chartData: data, unit: .suffix(of: NSLocalizedString("bpm", comment: "")))
5555
.yAxisLabels(chartData: data)
5656
.padding()
5757
} else {
5858
VStack (alignment: .center) {
5959
Spacer()
6060
HStack (alignment: .center) {
61-
Text("Insufficient Heart Rate Data")
61+
Text(NSLocalizedString("insufficient_heart_rate_data", comment: ""))
6262
.font(.title)
6363
}
6464
Spacer()

InfiniLink/View Components/ChartView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct ChartView: View {
1616
var body: some View {
1717
VStack {
1818
HStack {
19-
Text("Charts")
19+
Text(NSLocalizedString("charts", comment: ""))
2020
.font(.largeTitle)
2121
.padding(.leading)
2222
.padding(.vertical)

InfiniLink/View Components/DFU View/DFUComplete.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import SwiftUI
1212
struct DFUComplete: View {
1313

1414
var body: some View {
15-
Text("Transfer Completed!")
15+
Text(NSLocalizedString("transfer_completed", comment: ""))
1616
.font(.largeTitle)
1717
.padding()
1818
.foregroundColor(Color.white)

InfiniLink/View Components/DFU View/DFUFileSelectButton.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct DFUFileSelectButton: View {
2020
Button(action:{
2121
actionSheet.toggle()
2222
}) {
23-
Text("Select Firmware File")
23+
Text(NSLocalizedString("select_firmware_file", comment: ""))
2424
// .padding()
2525
// .padding(.vertical, 7)
2626
// .frame(maxWidth: .infinity, alignment: .center)
@@ -30,12 +30,12 @@ struct DFUFileSelectButton: View {
3030
// .padding(.horizontal, 20)
3131
}.disabled(!bleManager.isConnectedToPinetime)
3232
.actionSheet(isPresented: $actionSheet) {
33-
ActionSheet(title: Text("Select a File Source"), buttons: [
34-
.default(Text("Use Local File"), action: {
33+
ActionSheet(title: Text(NSLocalizedString("select_file_source", comment: "")), buttons: [
34+
.default(Text(NSLocalizedString("use_local_file", comment: "")), action: {
3535
openFile.toggle()
3636
DFU_Updater.shared.local = true
3737
}),
38-
.default(Text("Download Firmware File"), action: {
38+
.default(Text(NSLocalizedString("download_firmware_file", comment: "")), action: {
3939
//DownloadManager.shared.results = []
4040
SheetManager.shared.sheetSelection = .downloadUpdate
4141
SheetManager.shared.showSheet = true

0 commit comments

Comments
 (0)