浏览代码

Merge pull request #836 from deltachat/reword-autodel

use terms 'disappearing messages' and 'delete old messages'
cyBerta 5 年之前
父节点
当前提交
38d11f1af1

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

@@ -28,7 +28,7 @@ class ContactDetailViewController: UITableViewController {
 
     private lazy var ephemeralMessagesCell: UITableViewCell = {
         let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
-        cell.textLabel?.text = String.localized("pref_ephemeral_messages")
+        cell.textLabel?.text = String.localized("ephemeral_messages")
         cell.selectionStyle = .none
         cell.accessoryType = .disclosureIndicator
         return cell

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

@@ -92,7 +92,7 @@ class GroupChatDetailViewController: UIViewController {
 
     private lazy var ephemeralMessagesCell: UITableViewCell = {
         let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
-        cell.textLabel?.text = String.localized("pref_ephemeral_messages")
+        cell.textLabel?.text = String.localized("ephemeral_messages")
         cell.selectionStyle = .none
         cell.accessoryType = .disclosureIndicator
         return cell

+ 1 - 5
deltachat-ios/Controller/SettingsAutodelOverviewController.swift

@@ -16,10 +16,6 @@ class SettingsAutodelOverviewController: UITableViewController {
         case autodelServer = 1
     }
 
-    func autodelSummary() -> String {
-        return String.localized("off")
-    }
-
     private lazy var autodelDeviceCell: UITableViewCell = {
         let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
         cell.tag = CellTags.autodelDevice.rawValue
@@ -53,7 +49,7 @@ class SettingsAutodelOverviewController: UITableViewController {
     init(dcContext: DcContext) {
         self.dcContext = dcContext
         super.init(style: .grouped)
-        self.title = String.localized("autodel_title")
+        self.title = String.localized("delete_old_messages")
         hidesBottomBarWhenPushed = true
     }
 

+ 3 - 3
deltachat-ios/Controller/SettingsAutodelSetController.swift

@@ -12,7 +12,7 @@ class SettingsAutodelSetController: UITableViewController {
 
     private static let autodelDeviceOptions: [Options] = {
         return [
-            Options(value: 0, descr: "off"),
+            Options(value: 0, descr: "never"),
             Options(value: 3600, descr: "autodel_after_1_hour"),
             Options(value: 86400, descr: "autodel_after_1_day"),
             Options(value: 604800, descr: "autodel_after_1_week"),
@@ -23,7 +23,7 @@ class SettingsAutodelSetController: UITableViewController {
 
     private static let autodelServerOptions: [Options] = {
         return [
-            Options(value: 0, descr: "off"),
+            Options(value: 0, descr: "never"),
             Options(value: 1, descr: "autodel_at_once"),
             Options(value: 3600, descr: "autodel_after_1_hour"),
             Options(value: 86400, descr: "autodel_after_1_day"),
@@ -65,7 +65,7 @@ class SettingsAutodelSetController: UITableViewController {
         self.fromServer = fromServer
         self.currVal = dcContext.getConfigInt(fromServer ? "delete_server_after" :  "delete_device_after")
         super.init(style: .grouped)
-        self.title = String.localized("autodel_title_short")
+        self.title = String.localized("delete_old_messages")
         hidesBottomBarWhenPushed = true
     }
 

+ 21 - 5
deltachat-ios/Controller/SettingsController.swift

@@ -76,7 +76,7 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
         let delDeviceAfter = dcContext.getConfigInt("delete_device_after")
         let delServerAfter = dcContext.getConfigInt("delete_server_after")
         if delDeviceAfter==0 && delServerAfter==0 {
-            return String.localized("off")
+            return String.localized("never")
         } else {
             return String.localized("on")
         }
@@ -85,7 +85,7 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
     private lazy var autodelCell: UITableViewCell = {
         let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
         cell.tag = CellTags.autodel.rawValue
-        cell.textLabel?.text = String.localized("autodel_title")
+        cell.textLabel?.text = String.localized("delete_old_messages")
         cell.accessoryType = .disclosureIndicator
         cell.detailTextLabel?.text = autodelSummary()
         return cell
@@ -379,15 +379,31 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
         let locationStreaming = UserDefaults.standard.bool(forKey: "location_streaming")
         let title = locationStreaming ?
             "Disable on-demand location streaming" : String.localized("pref_on_demand_location_streaming")
-        alert.addAction(UIAlertAction(title: title, style: .default, handler: { _ in
+        alert.addAction(UIAlertAction(title: title, style: .default, handler: { [weak self] _ in
             UserDefaults.standard.set(!locationStreaming, forKey: "location_streaming")
+            if !locationStreaming {
+                let alert = UIAlertController(title: "Thanks for trying out the experimental feature 🧪 \"Location streaming\"",
+                                              message: "You will find a corresponding option in the attach menu (the paper clip) of each chat now.\n\n"
+                                                + "If you want to quit the experimental feature, you can disable it at \"Settings / Advanced\".",
+                                              preferredStyle: .alert)
+                alert.addAction(UIAlertAction(title: String.localized("ok"), style: .default, handler: nil))
+                self?.navigationController?.present(alert, animated: true, completion: nil)
+            }
         }))
 
         let ephemeralMessages = UserDefaults.standard.bool(forKey: "ephemeral_messages")
         let ephemeralTitle = ephemeralMessages ?
-            "Disable ephemeral messages" : "Enable ephemeral messages"
-        alert.addAction(UIAlertAction(title: ephemeralTitle, style: .default, handler: { _ in
+            "Disable disappearing messages options" : "Enable disappearing messages options"
+        alert.addAction(UIAlertAction(title: ephemeralTitle, style: .default, handler: { [weak self] _ in
             UserDefaults.standard.set(!ephemeralMessages, forKey: "ephemeral_messages")
+            if !ephemeralMessages {
+                let alert = UIAlertController(title: "Thanks for trying out the experimental feature 🧪 \"Disappearing messages\"",
+                                              message: "You will find a corresponding option in each chat profile now.\n\n"
+                                                + "If you want to quit the experimental feature, you can disable it at \"Settings / Advanced\".",
+                                              preferredStyle: .alert)
+                alert.addAction(UIAlertAction(title: String.localized("ok"), style: .default, handler: nil))
+                self?.navigationController?.present(alert, animated: true, completion: nil)
+            }
         }))
 
         let logAction = UIAlertAction(title: String.localized("pref_view_log"), style: .default, handler: { [weak self] _ in

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

@@ -34,7 +34,7 @@ class SettingsEphemeralMessageController: UITableViewController {
         self.chatId = chatId
         super.init(style: .grouped)
         self.currentIndex = self.options.index(of: dcContext.getChatEphemeralTimer(chatId: chatId)) ?? 0
-        self.title = String.localized("pref_ephemeral_messages")
+        self.title = String.localized("ephemeral_messages")
         hidesBottomBarWhenPushed = true
 
     }

+ 0 - 1
deltachat-ios/en.lproj/Localizable.strings

@@ -675,4 +675,3 @@
 "a11y_voice_message_hint_ios" = "After recording double-tap to send. To discard the recording scrub left-right with two fingers.";
 "login_error_no_internet_connection" = "No internet connection, can\'t log in to your server.";
 "share_account_not_configured" = "Account is not configured.";
-"pref_ephemeral_messages" = "Self-destructing messages";

+ 0 - 1
tools/untranslated.xml

@@ -8,5 +8,4 @@
     <string name="a11y_voice_message_hint_ios">After recording double-tap to send. To discard the recording scrub left-right with two fingers.</string>
     <string name="login_error_no_internet_connection">No internet connection, can\'t log in to your server.</string>
     <string name="share_account_not_configured">Account is not configured.</string>
-    <string name="pref_ephemeral_messages">Self-destructing messages</string>
 </resources>