Просмотр исходного кода

Merge pull request #754 from MikePlante1/typo-lint

Fix typo and linting
Sjoerd Bozon 9 месяцев назад
Родитель
Сommit
3ffe9e2d65

+ 10 - 4
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -13721,7 +13721,7 @@
         }
       }
     },
-    "• Manual boluses you enter yoursef" : {
+    "• Manual boluses you enter yourself" : {
 
     },
     "• Manual temporary basal rates you set yourself" : {
@@ -102968,7 +102968,7 @@
       }
     },
     "g" : {
-      "comment" : "Gram abbreviation\nThe short unit display string for grams\ngram of carbs",
+      "comment" : "Gram abbreviation\nThe short unit display string for grams\nUnits for carbs\ngram of carbs",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -124715,6 +124715,12 @@
         }
       }
     },
+    "Latest dev: %@" : {
+
+    },
+    "Latest dev: Fetching..." : {
+
+    },
     "Latest Raw Algorithm Output" : {
       "localizations" : {
         "bg" : {
@@ -223956,7 +223962,7 @@
       }
     },
     "U" : {
-      "comment" : "Insulin unit\nInsulin unit abbreviation\nThe short unit display string for international units of insulin",
+      "comment" : "Insulin unit\nInsulin unit abbreviation\nThe short unit display string for international units of insulin\nUnits for bolus amount",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -224169,7 +224175,7 @@
       }
     },
     "U/hr" : {
-      "comment" : "Insulin unit per hour abbreviation",
+      "comment" : "Insulin unit per hour abbreviation\nUnits text for temporary basal rate",
       "localizations" : {
         "bg" : {
           "stringUnit" : {

+ 1 - 1
Trio/Sources/Modules/GeneralSettings/View/UnitsLimitsSettingsRootView.swift

@@ -75,7 +75,7 @@ extension UnitsLimitsSettings {
 
                         VStack(alignment: .leading, spacing: 0) {
                             Text("What's NOT limited:")
-                            Text("• Manual boluses you enter yoursef")
+                            Text("• Manual boluses you enter yourself")
                             Text("• Manual temporary basal rates you set yourself")
                         }
                     }

+ 1 - 1
Trio/Sources/Modules/Onboarding/View/OnboardingView+Util.swift

@@ -417,7 +417,7 @@ enum DeliveryLimitSubstep: Int, CaseIterable, Identifiable {
 
                 VStack(alignment: .leading, spacing: 0) {
                     Text("What's NOT limited:")
-                    Text("• Manual boluses you enter yoursef")
+                    Text("• Manual boluses you enter yourself")
                     Text("• Manual temporary basal rates you set yourself")
                 }
             }

+ 1 - 1
Trio/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -398,7 +398,7 @@ extension Settings {
                     versionInfo.latestVersion = latestVersion
                     versionInfo.isUpdateAvailable = isNewer
                     versionInfo.isBlacklisted = isBlacklisted
-                    
+
                     // Fetch dev version if not on main branch
                     let buildDetails = BuildDetails.shared
                     if buildDetails.trioBranch != "main" {

+ 15 - 15
Trio/Sources/Services/AppVersionChecker/AppVersionChecker.swift

@@ -142,7 +142,7 @@ final class AppVersionChecker {
             completion(result.currentVersion, result.latestVersion, result.isNewer, result.isBlacklisted)
         }
     }
-    
+
     // Refreshes the version information and returns the current state (async version).
     //
     // This method triggers a version check (using cached values if valid or fetching fresh data)
@@ -175,7 +175,7 @@ final class AppVersionChecker {
             completion(result.0, result.1)
         }
     }
-    
+
     // Checks for the latest dev version with caching and comparison (async version).
     //
     // This method attempts to use cached dev version data if it is less than 24 hours old and
@@ -218,7 +218,7 @@ final class AppVersionChecker {
     // - isNewer: `true` if the fetched dev version is newer than the current version.
     private func fetchDevVersionAndUpdateCache(currentVersion: String) async -> (String?, Bool) {
         let versionData = await fetchData(for: .devVersionConfig)
-        
+
         // Parse the dev version from the fetched configuration data
         let configContents = versionData.flatMap { String(data: $0, encoding: .utf8) }
         let fetchedDevVersion = configContents.flatMap { self.parseDevVersionFromConfig(contents: $0) }
@@ -240,9 +240,9 @@ final class AppVersionChecker {
         } ?? false
 
         // Update persisted cache
-        self.persistedLatestDevVersion = fetchedDevVersion
-        self.latestDevVersionChecked = Date()
-        self.cachedForDevVersion = currentVersion
+        persistedLatestDevVersion = fetchedDevVersion
+        latestDevVersionChecked = Date()
+        cachedForDevVersion = currentVersion
 
         return (fetchedDevVersion, isNewer)
     }
@@ -265,7 +265,7 @@ final class AppVersionChecker {
             completion(result.0, result.1, result.2)
         }
     }
-    
+
     // Checks whether there is a new or blacklisted version (async version).
     //
     // This method attempts to use cached version data if it is less than 24 hours old and
@@ -322,9 +322,9 @@ final class AppVersionChecker {
         // Fetch both data types in parallel
         async let versionData = fetchData(for: .versionConfig)
         async let blacklistData = fetchData(for: .blacklistedVersions)
-        
+
         let (versionDataResult, blacklistDataResult) = await (versionData, blacklistData)
-        
+
         // Parse the version from the fetched configuration data.
         let fetchedVersion = versionDataResult
             .flatMap { String(data: $0, encoding: .utf8) }
@@ -343,10 +343,10 @@ final class AppVersionChecker {
             .contains(currentVersion) ?? false
 
         // Update persisted cache.
-        self.persistedLatestVersion = fetchedVersion
-        self.latestVersionChecked = Date()
-        self.currentVersionBlackListed = isBlacklisted
-        self.cachedForVersion = currentVersion
+        persistedLatestVersion = fetchedVersion
+        latestVersionChecked = Date()
+        currentVersionBlackListed = isBlacklisted
+        cachedForVersion = currentVersion
 
         return (fetchedVersion, isNewer, isBlacklisted)
     }
@@ -378,7 +378,7 @@ final class AppVersionChecker {
             return nil
         }
     }
-    
+
     // Legacy completion handler version for existing code
     private func fetchData(for dataType: GitHubDataType, completion: @escaping (Data?) -> Void) {
         guard let url = URL(string: dataType.url) else {
@@ -410,7 +410,7 @@ final class AppVersionChecker {
     private func parseVersionFromConfig(contents: String) -> String? {
         let lines = contents.split(separator: "\n")
         for line in lines {
-            if line.contains("APP_VERSION") && !line.contains("DEV") {
+            if line.contains("APP_VERSION"), !line.contains("DEV") {
                 let components = line.split(separator: "=").map {
                     $0.trimmingCharacters(in: .whitespacesAndNewlines)
                 }