More localization

This commit is contained in:
Garth Vander Houwen 2022-12-30 13:18:02 -08:00
parent 76e7eef10c
commit 59be21e38c
12 changed files with 200 additions and 204 deletions

View file

@ -68,6 +68,7 @@
DD913639270DFF4C00D7ACF3 /* LocalNotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD913638270DFF4C00D7ACF3 /* LocalNotificationManager.swift */; };
DD97E96628EFD9820056DDA4 /* MeshtasticLogo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD97E96528EFD9820056DDA4 /* MeshtasticLogo.swift */; };
DD97E96828EFE9A00056DDA4 /* About.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD97E96728EFE9A00056DDA4 /* About.swift */; };
DD994B69295F88B60013760A /* UpdateIntervals.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD994B68295F88B60013760A /* UpdateIntervals.swift */; };
DDA0B6B2294CDC55001356EC /* Channels.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA0B6B1294CDC55001356EC /* Channels.swift */; };
DDA1C48E28DB49D3009933EC /* ChannelRoles.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA1C48D28DB49D3009933EC /* ChannelRoles.swift */; };
DDA6B2E928419CF2003E8C16 /* MeshPackets.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA6B2E828419CF2003E8C16 /* MeshPackets.swift */; };
@ -104,6 +105,7 @@
DDD3BBD5292D763200D609B3 /* MeshtasticTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD3BBD4292D763200D609B3 /* MeshtasticTests.swift */; };
DDD94A502845C8F5004A87A0 /* DateTimeText.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD94A4F2845C8F5004A87A0 /* DateTimeText.swift */; };
DDD9E4E4284B208E003777C5 /* UserEntityExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD9E4E3284B208E003777C5 /* UserEntityExtension.swift */; };
DDE0F7C5295F77B700B8AAB3 /* AppSettingsEnums.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDE0F7C4295F77B700B8AAB3 /* AppSettingsEnums.swift */; };
DDF924CA26FBB953009FE055 /* ConnectedDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF924C926FBB953009FE055 /* ConnectedDevice.swift */; };
/* End PBXBuildFile section */
@ -187,6 +189,7 @@
DD913638270DFF4C00D7ACF3 /* LocalNotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotificationManager.swift; sourceTree = "<group>"; };
DD97E96528EFD9820056DDA4 /* MeshtasticLogo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshtasticLogo.swift; sourceTree = "<group>"; };
DD97E96728EFE9A00056DDA4 /* About.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = About.swift; sourceTree = "<group>"; };
DD994B68295F88B60013760A /* UpdateIntervals.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateIntervals.swift; sourceTree = "<group>"; };
DDA0B6B1294CDC55001356EC /* Channels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Channels.swift; sourceTree = "<group>"; };
DDA1C48D28DB49D3009933EC /* ChannelRoles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelRoles.swift; sourceTree = "<group>"; };
DDA6B2E828419CF2003E8C16 /* MeshPackets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshPackets.swift; sourceTree = "<group>"; };
@ -231,6 +234,7 @@
DDD3BBD4292D763200D609B3 /* MeshtasticTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MeshtasticTests.swift; sourceTree = "<group>"; };
DDD94A4F2845C8F5004A87A0 /* DateTimeText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateTimeText.swift; sourceTree = "<group>"; };
DDD9E4E3284B208E003777C5 /* UserEntityExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserEntityExtension.swift; sourceTree = "<group>"; };
DDE0F7C4295F77B700B8AAB3 /* AppSettingsEnums.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSettingsEnums.swift; sourceTree = "<group>"; };
DDEE03EC29544A1000FCAD57 /* MeshtasticDataModelV4.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MeshtasticDataModelV4.xcdatamodel; sourceTree = "<group>"; };
DDF924C926FBB953009FE055 /* ConnectedDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectedDevice.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -360,6 +364,7 @@
DD8ED9C6289CE4A100B3B0AB /* Enums */ = {
isa = PBXGroup;
children = (
DDE0F7C4295F77B700B8AAB3 /* AppSettingsEnums.swift */,
DDB6ABD828B0A4BA00384BA1 /* BluetoothModes.swift */,
DD1925B628CDA5A400720036 /* CannedMessagesConfigEnums.swift */,
DDA1C48D28DB49D3009933EC /* ChannelRoles.swift */,
@ -371,6 +376,7 @@
DDB6ABE128B13FB500384BA1 /* PositionConfigEnums.swift */,
DD8ED9C7289CE4B900B3B0AB /* RoutingError.swift */,
DD1925B828CDA93900720036 /* SerialConfigEnums.swift */,
DD994B68295F88B60013760A /* UpdateIntervals.swift */,
);
path = Enums;
sourceTree = "<group>";
@ -753,6 +759,7 @@
DD3CC6B528E33FD100FA9159 /* ShareChannels.swift in Sources */,
DD1BF2F92776FE2E008C8D2F /* UserMessageList.swift in Sources */,
DD3CC6C228EB9D4900FA9159 /* UpdateCoreData.swift in Sources */,
DDE0F7C5295F77B700B8AAB3 /* AppSettingsEnums.swift in Sources */,
DDB6ABE628B1406100384BA1 /* LoraConfigEnums.swift in Sources */,
DDB2CC6E27F3EB47009C5FCC /* telemetry.pb.swift in Sources */,
DD23A50F26FD1B4400D9B90C /* PeripheralModel.swift in Sources */,
@ -794,6 +801,7 @@
C9A88B57278B559900BD810A /* apponly.pb.swift in Sources */,
DD4C158E2824AA7E0032668E /* config.pb.swift in Sources */,
DDB6ABE228B13FB500384BA1 /* PositionConfigEnums.swift in Sources */,
DD994B69295F88B60013760A /* UpdateIntervals.swift in Sources */,
DD415828285859C4009B0E59 /* TelemetryConfig.swift in Sources */,
DD73FD1128750779000852D6 /* PositionLog.swift in Sources */,
DD3CC6C028E7A60700FA9159 /* MessagingEnums.swift in Sources */,

View file

@ -0,0 +1,93 @@
//
// AppSettingsEnums.swift
// Meshtastic
//
// Copyright(c) Garth Vander Houwen 12/30/22.
//
import Foundation
enum KeyboardType: Int, CaseIterable, Identifiable {
case defaultKeyboard = 0
case asciiCapable = 1
case twitter = 9
case emailAddress = 7
case numbersAndPunctuation = 2
var id: Int { self.rawValue }
var description: String {
get {
switch self {
case .defaultKeyboard:
return NSLocalizedString("default", comment: "Default Keyboard")
case .asciiCapable:
return NSLocalizedString("ascii.capable", comment: "ASCII Capable Keyboard")
case .twitter:
return NSLocalizedString("twitter", comment: "Twitter Keyboard")
case .emailAddress:
return NSLocalizedString("email.address", comment: "Email Address Keyboard")
case .numbersAndPunctuation:
return NSLocalizedString("numbers.punctuation", comment: "Numbers and Punctuation Keyboard")
}
}
}
}
enum MeshMapType: String, CaseIterable, Identifiable {
case satellite = "satellite"
case hybrid = "hybrid"
case standard = "standard"
var id: String { self.rawValue }
var description: String {
get {
switch self {
case .satellite:
return NSLocalizedString("satellite", comment: "Satellite Map Type")
case .standard:
return NSLocalizedString("standard", comment: "Standard Map Type")
case .hybrid:
return NSLocalizedString("hybrid", comment: "Hybrid Map Type")
}
}
}
}
enum LocationUpdateInterval: Int, CaseIterable, Identifiable {
case fiveSeconds = 5
case tenSeconds = 10
case fifteenSeconds = 15
case thirtySeconds = 30
case oneMinute = 60
case fiveMinutes = 300
case tenMinutes = 600
case fifteenMinutes = 900
var id: Int { self.rawValue }
var description: String {
get {
switch self {
case .fiveSeconds:
return NSLocalizedString("interval.five.seconds", comment: "Five Seconds")
case .tenSeconds:
return NSLocalizedString("interval.ten.seconds", comment: "Ten Seconds")
case .fifteenSeconds:
return NSLocalizedString("interval.fifteen.seconds", comment: "Fifteen Seconds")
case .thirtySeconds:
return NSLocalizedString("interval.thirty.seconds", comment: "Thirty Seconds")
case .oneMinute:
return NSLocalizedString("interval.one.minute", comment: "One Minute")
case .fiveMinutes:
return NSLocalizedString("interval.five.minutes", comment: "Five Minutes")
case .tenMinutes:
return NSLocalizedString("interval.ten.minutes", comment: "Ten Minutes")
case .fifteenMinutes:
return NSLocalizedString("interval.fifteen.minutes", comment: "Fifteen Minutes")
}
}
}
}

View file

@ -7,52 +7,6 @@
import Foundation
enum PositionBroadcastIntervals: Int, CaseIterable, Identifiable {
case fifteenSeconds = 15
case thirtySeconds = 30
case oneMinute = 60
case fiveMinutes = 300
case tenMinutes = 600
case fifteenMinutes = 900
case thirtyMinutes = 1800
case oneHour = 3600
case sixHours = 21600
case twelveHours = 43200
case twentyFourHours = 86400
var id: Int { self.rawValue }
var description: String {
get {
switch self {
case .fifteenSeconds:
return NSLocalizedString("interval.fifteen.seconds", comment: "Fifteen Seconds")
case .thirtySeconds:
return NSLocalizedString("interval.thirty.seconds", comment: "Thirty Seconds")
case .oneMinute:
return NSLocalizedString("interval.one.minute", comment: "One Minute")
case .fiveMinutes:
return NSLocalizedString("interval.five.minutes", comment: "Five Minutes")
case .tenMinutes:
return NSLocalizedString("interval.ten.minutes", comment: "Ten Minutes")
case .fifteenMinutes:
return NSLocalizedString("interval.fifteen.minutes", comment: "Fifteen Minutes")
case .thirtyMinutes:
return NSLocalizedString("interval.thirty.minutes", comment: "Thirty Minutes")
case .oneHour:
return NSLocalizedString("interval.one.hour", comment: "One Hour")
case .sixHours:
return NSLocalizedString("interval.six.hours", comment: "Six Hours")
case .twelveHours:
return NSLocalizedString("interval.twelve.hours", comment: "Twelve Hours")
case .twentyFourHours:
return NSLocalizedString("interval.twentyfour.hours", comment: "Twenty Four Hours")
}
}
}
}
enum GpsFormats: Int, CaseIterable, Identifiable {
case gpsFormatDec = 0

View file

@ -0,0 +1,78 @@
//
// UpdateIntervals.swift
// Meshtastic
//
// Created by Garth Vander Houwen on 12/30/22.
//
import Foundation
enum UpdateIntervals: Int, CaseIterable, Identifiable {
case fifteenSeconds = 15
case thirtySeconds = 30
case oneMinute = 60
case fiveMinutes = 300
case tenMinutes = 600
case fifteenMinutes = 900
case thirtyMinutes = 1800
case oneHour = 3600
case twoHours = 7200
case threeHours = 10800
case fourHours = 14400
case fiveHours = 18000
case sixHours = 21600
case twelveHours = 43200
case eighteenHours = 64800
case twentyFourHours = 86400
case thirtySixHours = 129600
case fortyeightHours = 172800
case seventyTwoHours = 259200
var id: Int { self.rawValue }
var description: String {
get {
switch self {
case .fifteenSeconds:
return NSLocalizedString("interval.fifteen.seconds", comment: "Fifteen Seconds")
case .thirtySeconds:
return NSLocalizedString("interval.thirty.seconds", comment: "Thirty Seconds")
case .oneMinute:
return NSLocalizedString("interval.one.minute", comment: "One Minute")
case .fiveMinutes:
return NSLocalizedString("interval.five.minutes", comment: "Five Minutes")
case .tenMinutes:
return NSLocalizedString("interval.ten.minutes", comment: "Ten Minutes")
case .fifteenMinutes:
return NSLocalizedString("interval.fifteen.minutes", comment: "Fifteen Minutes")
case .thirtyMinutes:
return NSLocalizedString("interval.thirty.minutes", comment: "Thirty Minutes")
case .oneHour:
return NSLocalizedString("interval.one.hour", comment: "One Hour")
case .twoHours:
return NSLocalizedString("interval.two.hours", comment: "Two Hours")
case .threeHours:
return NSLocalizedString("interval.three.hours", comment: "Three Hours")
case .fourHours:
return NSLocalizedString("interval.four.hours", comment: "Four Hours")
case .fiveHours:
return NSLocalizedString("interval.five.hours", comment: "Five Hours")
case .sixHours:
return NSLocalizedString("interval.six.hours", comment: "Six Hours")
case .twelveHours:
return NSLocalizedString("interval.twelve.hours", comment: "Twelve Hours")
case .eighteenHours:
return NSLocalizedString("interval.eighteen.hours", comment: "Eighteen Hours")
case .twentyFourHours:
return NSLocalizedString("interval.twentyfour.hours", comment: "Twenty Four Hours")
case .thirtySixHours:
return NSLocalizedString("interval.thirtysix.hours", comment: "Thirty Six Hours")
case .fortyeightHours:
return NSLocalizedString("interval.fortyeight.hours", comment: "Forty Eight Hours")
case .seventyTwoHours:
return NSLocalizedString("interval.seventytwo.hours", comment: "Seventy Two Hours")
}
}
}
}

View file

@ -7,6 +7,7 @@
import UIKit
import MapKit
import SwiftUI
// a simple circle annotation, with a string in it
class PositionAnnotation: NSObject, MKAnnotation {
@ -53,11 +54,7 @@ class PositionAnnotationView: MKAnnotationView {
guard let context = UIGraphicsGetCurrentContext() else { return }
let circleRect = CGRect(x: 1, y: 1, width: 38, height: 38)
context.setFillColor(CGColor(red: 0, green: 0.5, blue: 1.0, alpha: 1.0))
context.setFillColor(Color.accentColor.cgColor ?? CGColor(red: 0, green: 0.5, blue: 1.0, alpha: 1.0))
context.fillEllipse(in: circleRect)
}
}

View file

@ -84,8 +84,6 @@ struct NodeMap: View {
var body: some View {
//self.$userLocation = LocationHelper.currentLocation
NavigationStack {
ZStack {
@ -112,11 +110,9 @@ struct NodeMap: View {
)
.frame(maxHeight: .infinity)
.ignoresSafeArea(.all, edges: [.leading, .trailing])
}
.ignoresSafeArea(.all, edges: [.top, .leading, .trailing])
}
}
.navigationTitle("Mesh Map")
.navigationBarTitleDisplayMode(.inline)
.navigationBarItems(leading:
MeshtasticLogo(), trailing:

View file

@ -4,91 +4,6 @@ import SwiftUI
import SwiftProtobuf
import MapKit
enum KeyboardType: Int, CaseIterable, Identifiable {
case defaultKeyboard = 0
case asciiCapable = 1
case twitter = 9
case emailAddress = 7
case numbersAndPunctuation = 2
var id: Int { self.rawValue }
var description: String {
get {
switch self {
case .defaultKeyboard:
return NSLocalizedString("default", comment: "Default Keyboard")
case .asciiCapable:
return NSLocalizedString("ascii.capable", comment: "ASCII Capable Keyboard")
case .twitter:
return NSLocalizedString("twitter", comment: "Twitter Keyboard")
case .emailAddress:
return NSLocalizedString("email.address", comment: "Email Address Keyboard")
case .numbersAndPunctuation:
return NSLocalizedString("numbers.punctuation", comment: "Numbers and Punctuation Keyboard")
}
}
}
}
enum MeshMapType: String, CaseIterable, Identifiable {
case satellite = "satellite"
case hybrid = "hybrid"
case standard = "standard"
var id: String { self.rawValue }
var description: String {
get {
switch self {
case .satellite:
return NSLocalizedString("satellite", comment: "Satellite Map Type")
case .standard:
return NSLocalizedString("standard", comment: "Standard Map Type")
case .hybrid:
return NSLocalizedString("hybrid", comment: "Hybrid Map Type")
}
}
}
}
enum LocationUpdateInterval: Int, CaseIterable, Identifiable {
case fiveSeconds = 5
case tenSeconds = 10
case fifteenSeconds = 15
case thirtySeconds = 30
case oneMinute = 60
case fiveMinutes = 300
case tenMinutes = 600
case fifteenMinutes = 900
var id: Int { self.rawValue }
var description: String {
get {
switch self {
case .fiveSeconds:
return NSLocalizedString("interval.five.seconds", comment: "Five Seconds")
case .tenSeconds:
return NSLocalizedString("interval.ten.seconds", comment: "Ten Seconds")
case .fifteenSeconds:
return NSLocalizedString("interval.fifteen.seconds", comment: "Fifteen Seconds")
case .thirtySeconds:
return NSLocalizedString("interval.thirty.seconds", comment: "Thirty Seconds")
case .oneMinute:
return NSLocalizedString("interval.one.minute", comment: "One Minute")
case .fiveMinutes:
return NSLocalizedString("interval.five.minutes", comment: "Five Minutes")
case .tenMinutes:
return NSLocalizedString("interval.ten.minutes", comment: "Ten Minutes")
case .fifteenMinutes:
return NSLocalizedString("interval.fifteen.minutes", comment: "Fifteen Minutes")
}
}
}
}
struct AppSettings: View {
@Environment(\.managedObjectContext) var context

View file

@ -276,7 +276,6 @@ struct Channels: View {
}
}
.navigationTitle("channels")
.navigationSplitViewStyle(.automatic)
.navigationBarItems(trailing:
ZStack {
ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "????")

View file

@ -6,66 +6,6 @@
//
import SwiftUI
enum UpdateIntervals: Int, CaseIterable, Identifiable {
case fifteenSeconds = 15
case thirtySeconds = 30
case oneMinute = 60
case fiveMinutes = 300
case tenMinutes = 600
case fifteenMinutes = 900
case thirtyMinutes = 1800
case oneHour = 3600
case twoHours = 7200
case threeHours = 10800
case fourHours = 14400
case fiveHours = 18000
case sixHours = 21600
case twelveHours = 43200
case eighteenHours = 64800
case twentyFourHours = 86400
var id: Int { self.rawValue }
var description: String {
get {
switch self {
case .fifteenSeconds:
return "Fifteen Seconds"
case .thirtySeconds:
return "Thirty Seconds"
case .oneMinute:
return "One Minute"
case .fiveMinutes:
return "Five Minutes"
case .tenMinutes:
return "Ten Minutes"
case .fifteenMinutes:
return "Fifteen Minutes"
case .thirtyMinutes:
return "Thirty Minutes"
case .oneHour:
return "One Hour"
case .twoHours:
return "Two Hours"
case .threeHours:
return "Three Hours"
case .fourHours:
return "Four Hours"
case .fiveHours:
return "Five Hours"
case .sixHours:
return "Six Hours"
case .twelveHours:
return "Twelve Hours"
case .eighteenHours:
return "Eighteen Hours"
case .twentyFourHours:
return "Twenty Four Hours"
}
}
}
}
struct TelemetryConfig: View {
@Environment(\.managedObjectContext) var context

View file

@ -113,7 +113,7 @@ struct PositionConfig: View {
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
Picker("Position Broadcast Interval", selection: $positionBroadcastSeconds) {
ForEach(PositionBroadcastIntervals.allCases) { at in
ForEach(UpdateIntervals.allCases) { at in
Text(at.description)
}
}

View file

@ -102,9 +102,17 @@
"interval.fifteen.minutes"="Fünfzehn Minutes";
"interval.thirty.minutes"="Dreißig Minutes";
"interval.one.hour"="Eine Stunde";
"interval.two.hours"="Two Hours";
"interval.three.hours"="Three Hours";
"interval.four.hours"="Four Hours";
"interval.five.hours"="Five Hours";
"interval.six.hours"="Sechs Stunden";
"interval.twelve.hours"="Zwölf Stunden";
"interval.eighteen.hours"="Eighteen Hours";
"interval.twentyfour.hours"="Vierundzwanzig Stunden";
"interval.thirtysix.hours"="Thirty Six Hours";
"interval.fortyeight.hours"="Forty Eight Hours Hours";
"interval.seventytwo.hours"="Seventy Two Hours";
"keyboard.type"="Keyboard Typ";
"logging"="Logging";
"lora"="LoRa";

View file

@ -99,9 +99,17 @@
"interval.fifteen.minutes"="Fifteen Minutes";
"interval.thirty.minutes"="Thirty Minutes";
"interval.one.hour"="One Hour";
"interval.two.hours"="Two Hours";
"interval.three.hours"="Three Hours";
"interval.four.hours"="Four Hours";
"interval.five.hours"="Five Hours";
"interval.six.hours"="Six Hours";
"interval.twelve.hours"="Twelve Hours";
"interval.eighteen.hours"="Eighteen Hours";
"interval.twentyfour.hours"="Twenty Four Hours";
"interval.thirtysix.hours"="Thirty Six Hours";
"interval.fortyeight.hours"="Forty Eight Hours Hours";
"interval.seventytwo.hours"="Seventy Two Hours";
"keyboard.type"="Keyboard Type";
"logging"="Logging";
"lora"="LoRa";