Explorar el Código

Fix localization format strings and wire up missing .localized calls.

Use positional placeholders for Korean and Chinese calendar summaries, and localize settings, browse, and Keychain error copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 hace 1 mes
padre
commit
f2297d21b7

+ 5 - 5
meetings_app/Auth/KeychainTokenStore.swift

@@ -54,13 +54,13 @@ final class KeychainTokenStore {
         let status = SecItemCopyMatching(query as CFDictionary, &result)
         if status == errSecItemNotFound { return nil }
         guard status == errSecSuccess else {
-            throw makeKeychainError(status: status, message: "Failed to read OAuth tokens from Keychain.")
+            throw makeKeychainError(status: status, message: "Failed to read OAuth tokens from Keychain.".localized)
         }
         guard let data = result as? Data else {
             throw NSError(
                 domain: NSOSStatusErrorDomain,
                 code: Int(errSecDecode),
-                userInfo: [NSLocalizedDescriptionKey: "Keychain returned an invalid token payload."]
+                userInfo: [NSLocalizedDescriptionKey: "Keychain returned an invalid token payload.".localized]
             )
         }
         return try JSONDecoder().decode(GoogleOAuthTokens.self, from: data)
@@ -96,7 +96,7 @@ final class KeychainTokenStore {
         let updateStatus = SecItemUpdate(baseQuery as CFDictionary, attributesToUpdate as CFDictionary)
         if updateStatus == errSecSuccess { return }
         if updateStatus != errSecItemNotFound {
-            throw makeKeychainError(status: updateStatus, message: "Failed to update OAuth tokens in Keychain.")
+            throw makeKeychainError(status: updateStatus, message: "Failed to update OAuth tokens in Keychain.".localized)
         }
 
         var addQuery = baseQuery
@@ -104,14 +104,14 @@ final class KeychainTokenStore {
         addQuery[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlock
         let addStatus = SecItemAdd(addQuery as CFDictionary, nil)
         guard addStatus == errSecSuccess else {
-            throw makeKeychainError(status: addStatus, message: "Failed to save OAuth tokens to Keychain.")
+            throw makeKeychainError(status: addStatus, message: "Failed to save OAuth tokens to Keychain.".localized)
         }
     }
 
     func deleteTokens() throws {
         let status = SecItemDelete(baseQuery() as CFDictionary)
         guard status == errSecSuccess || status == errSecItemNotFound else {
-            throw makeKeychainError(status: status, message: "Failed to delete OAuth tokens from Keychain.")
+            throw makeKeychainError(status: status, message: "Failed to delete OAuth tokens from Keychain.".localized)
         }
     }
 

+ 3 - 3
meetings_app/ViewController.swift

@@ -4583,7 +4583,7 @@ private extension ViewController {
         }
 
         if storeKitCoordinator.hasPremiumAccess {
-            let notificationsTitle = textLabel("Notifications", font: typography.joinWithURLTitle, color: palette.textPrimary)
+            let notificationsTitle = textLabel("Notifications".localized, font: typography.joinWithURLTitle, color: palette.textPrimary)
             stack.addArrangedSubview(notificationsTitle)
             let remindersSection = makeSettingsRemindersSection()
             stack.addArrangedSubview(remindersSection)
@@ -4989,7 +4989,7 @@ private extension ViewController {
         let titleLabel = textLabel("Browse the web".localized, font: typography.pageTitle, color: palette.textPrimary)
         titleLabel.translatesAutoresizingMaskIntoConstraints = false
         let sub = textLabel(
-            "Open sites in the in-app browser (back, forward, reload, address bar). OAuth and “Continue in browser” flows stay inside the app.",
+            "Open sites in the in-app browser (back, forward, reload, address bar). OAuth and “Continue in browser” flows stay inside the app.".localized,
             font: typography.fieldLabel,
             color: palette.textSecondary
         )
@@ -5016,7 +5016,7 @@ private extension ViewController {
         fieldShell.addSubview(field)
 
         let openBtn = meetActionButton(
-            title: "Open in app browser",
+            title: "Open in app browser".localized,
             color: palette.primaryBlue,
             textColor: .white,
             width: 220,

+ 1 - 1
meetings_app/ko.lproj/Localizable.strings

@@ -340,7 +340,7 @@
 "No meetings for selected filters" = "선택한 필터에 대한 회의 없음";
 "No meetings on %@" = "%@에 회의 없음";
 "1 meeting on %@" = "%@에 회의 1개";
-"%d meetings on %@" = "%@에 회의 %d개";
+"%d meetings on %@" = "%2$@에 회의 %1$d개";
 "All day" = "하루 종일";
 "Duration: all day" = "시간: 하루 종일";
 "Duration: %dh %dm" = "시간: %dh %dm";

+ 1 - 1
meetings_app/zh-Hans.lproj/Localizable.strings

@@ -340,7 +340,7 @@
 "No meetings for selected filters" = "所选筛选条件无会议";
 "No meetings on %@" = "%@ 无会议";
 "1 meeting on %@" = "%@ 有 1 个会议";
-"%d meetings on %@" = "%@ 有 %d 个会议";
+"%d meetings on %@" = "%2$@ 有 %1$d 个会议";
 "All day" = "全天";
 "Duration: all day" = "时长:全天";
 "Duration: %dh %dm" = "时长:%dh %dm";

+ 1 - 1
meetings_app/zh-Hant.lproj/Localizable.strings

@@ -340,7 +340,7 @@
 "No meetings for selected filters" = "所選篩選條件無會議";
 "No meetings on %@" = "%@ 無會議";
 "1 meeting on %@" = "%@ 有 1 個會議";
-"%d meetings on %@" = "%@ 有 %d 個會議";
+"%d meetings on %@" = "%2$@ 有 %1$d 個會議";
 "All day" = "全天";
 "Duration: all day" = "持續時間:全天";
 "Duration: %dh %dm" = "持續時間:%dh %dm";