Browse Source

do not talk of 'Group' when editing mailinglists or broadcasts

B. Petersen 3 years ago
parent
commit
18ac671529
1 changed files with 6 additions and 4 deletions
  1. 6 4
      deltachat-ios/Controller/EditGroupViewController.swift

+ 6 - 4
deltachat-ios/Controller/EditGroupViewController.swift

@@ -7,6 +7,7 @@ class EditGroupViewController: UITableViewController, MediaPickerDelegate {
 
     private var changeGroupImage: UIImage?
     private var deleteGroupImage: Bool = false
+    private var useGroupWording: Bool
 
     private let rowGroupName = 0
     private let rowAvatar = 1
@@ -20,7 +21,7 @@ class EditGroupViewController: UITableViewController, MediaPickerDelegate {
     }()
 
     lazy var groupNameCell: TextFieldCell = {
-        let cell = TextFieldCell(description: String.localized("group_name"), placeholder: self.chat.name)
+        let cell = TextFieldCell(description: String.localized(useGroupWording ? "group_name" : "name_desktop"), placeholder: self.chat.name)
         cell.setText(text: self.chat.name)
         cell.onTextFieldChange = self.groupNameEdited(_:)
         return cell
@@ -41,10 +42,11 @@ class EditGroupViewController: UITableViewController, MediaPickerDelegate {
         self.dcContext = dcContext
         self.chat = chat
         self.avatarSelectionCell = AvatarSelectionCell(image: chat.profileImage)
+        self.useGroupWording = !chat.isBroadcast && !chat.isMailinglist
         super.init(style: .grouped)
-        self.avatarSelectionCell.hintLabel.text = String.localized("group_avatar")
+        self.avatarSelectionCell.hintLabel.text = String.localized(useGroupWording ? "group_avatar" : "image")
         self.avatarSelectionCell.onAvatarTapped = onAvatarTapped
-        title = String.localized("menu_edit_group")
+        title = String.localized(useGroupWording ? "menu_edit_group" : "global_menu_edit_desktop")
     }
 
     required init?(coder aDecoder: NSCoder) {
@@ -94,7 +96,7 @@ class EditGroupViewController: UITableViewController, MediaPickerDelegate {
     }
 
     private func onAvatarTapped() {
-        let alert = UIAlertController(title: String.localized("group_avatar"), message: nil, preferredStyle: .safeActionSheet)
+        let alert = UIAlertController(title: String.localized(useGroupWording ? "group_avatar" : "image"), message: nil, preferredStyle: .safeActionSheet)
             alert.addAction(PhotoPickerAlertAction(title: String.localized("camera"), style: .default, handler: cameraButtonPressed(_:)))
             alert.addAction(PhotoPickerAlertAction(title: String.localized("gallery"), style: .default, handler: galleryButtonPressed(_:)))
             if avatarSelectionCell.isAvatarSet() {