Explorar o código

avoid direct calls to NSLocalizedString that skip the fallback to english strings

B. Petersen %!s(int64=5) %!d(string=hai) anos
pai
achega
9b625f375e

+ 1 - 1
deltachat-ios/Controller/ChatViewController.swift

@@ -258,7 +258,7 @@ class ChatViewController: MessagesViewController {
         var subtitle = "ErrSubtitle"
         let chatContactIds = chat.contactIds
         if chat.isGroup {
-            subtitle = String.localizedStringWithFormat(NSLocalizedString("n_members", comment: ""), chatContactIds.count)
+            subtitle = String.localized(stringID: "n_members", count: chatContactIds.count)
         } else if chatContactIds.count >= 1 {
             if chat.isDeviceTalk {
                 subtitle = String.localized("device_talk_subtitle")

+ 1 - 1
deltachat-ios/Controller/ProfileInfoViewController.swift

@@ -81,7 +81,7 @@ class ProfileInfoViewController: UITableViewController {
     override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
         let email = dcContext.addr ?? ""
         let footerTitle = String.localizedStringWithFormat(
-            NSLocalizedString("qraccount_success_enter_name", comment: ""), email
+            String.localized("qraccount_success_enter_name"), email
         )
         return footerTitle
     }

+ 1 - 1
deltachat-ios/Controller/WelcomeViewController.swift

@@ -143,7 +143,7 @@ extension WelcomeViewController: QrCodeReaderDelegate {
     }
 
     private func confirmAccountCreationAlert(accountDomain domain: String, qrCode: String) {
-        let title = String.localizedStringWithFormat(NSLocalizedString("qraccount_ask_create_and_login", comment: ""), domain)
+        let title = String.localizedStringWithFormat(String.localized("qraccount_ask_create_and_login"), domain)
         let alert = UIAlertController(title: title, message: nil, preferredStyle: .alert)
 
         let okAction = UIAlertAction(

+ 1 - 1
deltachat-ios/ViewModel/ChatListViewModel.swift

@@ -129,7 +129,7 @@ class ChatListViewModel: NSObject, ChatListViewModelProtocol {
             case .messages:
                 title = "n_messages"
             }
-            return String.localizedStringWithFormat(NSLocalizedString(title, comment: ""), numberOfRowsIn(section: section))
+            return String.localized(stringID: title, count: numberOfRowsIn(section: section))
         }
         return nil
     }