extract dismiss string -> CommonStrings.dismissButton

// FREEBIE
pull/1/head
Michael Kirk 7 years ago
parent 20a8e72198
commit a59eb25aef

@ -9,7 +9,7 @@ import Foundation
*/
@objc class CommonStrings: NSObject {
static let dismissActionText = NSLocalizedString("DISMISS_BUTTON_TEXT", comment: "Short text to dismiss current modal / actionsheet / screen")
static let dismissButton = NSLocalizedString("DISMISS_BUTTON_TEXT", comment: "Short text to dismiss current modal / actionsheet / screen")
}
@objc class CallStrings: NSObject {

@ -371,7 +371,6 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
setButtonSelectedImage(button: videoModeMuteButton, imageName: "video-mute-selected")
setButtonSelectedImage(button: audioModeVideoButton, imageName: "audio-call-video-active")
setButtonSelectedImage(button: videoModeVideoButton, imageName: "video-video-selected")
// setButtonSelectedImage(button: audioRouteButton, imageName: "audio-call-speaker-active")
ongoingCallView = createContainerForCallControls(controlGroups : [
[audioModeMuteButton, audioRouteButton, audioModeVideoButton ],
@ -392,7 +391,7 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
let actionSheetController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
let dismissAction = UIAlertAction(title: CommonStrings.dismissActionText, style: .cancel, handler: nil)
let dismissAction = UIAlertAction(title: CommonStrings.dismissButton, style: .cancel, handler: nil)
actionSheetController.addAction(dismissAction)
let currentAudioSource = callUIAdapter.audioService.currentAudioSource(call: self.call)

@ -301,7 +301,7 @@ NS_ASSUME_NONNULL_BEGIN
message:error.localizedDescription
preferredStyle:UIAlertControllerStyleAlert];
}
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"DISMISS_BUTTON_TEXT", nil)
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:CommonStrings.dismissButton
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
[_challengeTextField becomeFirstResponder];

@ -872,13 +872,11 @@ typedef enum : NSUInteger {
}];
[actionSheetController addAction:verifyAction];
UIAlertAction *dismissAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"DISMISS_BUTTON_TEXT",
@"Generic short text for button to dismiss a dialog")
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *_Nonnull action) {
[weakSelf resetVerificationStateToDefault];
}];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:CommonStrings.dismissButton
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *_Nonnull action) {
[weakSelf resetVerificationStateToDefault];
}];
[actionSheetController addAction:dismissAction];
[self presentViewController:actionSheetController animated:YES completion:nil];
@ -2950,9 +2948,8 @@ typedef enum : NSUInteger {
@"Alert body when picking a document fails because user picked a directory/bundle")
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"DISMISS_BUTTON_TEXT", nil)
style:UIAlertActionStyleCancel
handler:nil];
UIAlertAction *dismissAction =
[UIAlertAction actionWithTitle:CommonStrings.dismissButton style:UIAlertActionStyleCancel handler:nil];
[alertController addAction:dismissAction];
dispatch_async(dispatch_get_main_queue(), ^{
@ -2978,9 +2975,8 @@ typedef enum : NSUInteger {
message:nil
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"DISMISS_BUTTON_TEXT", nil)
style:UIAlertActionStyleCancel
handler:nil];
UIAlertAction *dismissAction =
[UIAlertAction actionWithTitle:CommonStrings.dismissButton style:UIAlertActionStyleCancel handler:nil];
[alertController addAction:dismissAction];
dispatch_async(dispatch_get_main_queue(), ^{

@ -194,7 +194,7 @@ class ExperienceUpgradesPageViewController: UIViewController, UIPageViewControll
// Dismiss button
let dismissButton = UIButton()
view.addSubview(dismissButton)
dismissButton.setTitle(NSLocalizedString("DISMISS_BUTTON_TEXT", comment: ""), for: .normal)
dismissButton.setTitle(CommonStrings.dismissButton, for: .normal)
dismissButton.setTitleColor(UIColor.white, for: .normal)
dismissButton.isUserInteractionEnabled = true
dismissButton.addTarget(self, action:#selector(didTapDismissButton), for: .touchUpInside)

@ -189,7 +189,6 @@ NS_ASSUME_NONNULL_BEGIN
DDLogInfo(@"%@ Successfully verified safety numbers.", tag);
NSString *successTitle = NSLocalizedString(@"SUCCESSFUL_VERIFICATION_TITLE", nil);
NSString *dismissText = NSLocalizedString(@"DISMISS_BUTTON_TEXT", nil);
NSString *descriptionFormat = NSLocalizedString(
@"SUCCESSFUL_VERIFICATION_DESCRIPTION", @"Alert body after verifying privacy with {{other user's name}}");
NSString *successDescription = [NSString stringWithFormat:descriptionFormat, contactName];
@ -209,7 +208,7 @@ NS_ASSUME_NONNULL_BEGIN
[viewController dismissViewControllerAnimated:true completion:nil];
}]];
UIAlertAction *dismissAction =
[UIAlertAction actionWithTitle:dismissText
[UIAlertAction actionWithTitle:CommonStrings.dismissButton
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
[viewController dismissViewControllerAnimated:true completion:nil];

@ -1,5 +1,6 @@
// Created by Michael Kirk on 11/18/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
import Foundation
import Social
@ -31,7 +32,7 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
super.init()
actionSheetController.addAction(dismissAction())
if #available(iOS 9.0, *) {
if let messageAction = messageAction() {
actionSheetController.addAction(messageAction)
@ -72,7 +73,7 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
twitterViewController.add(#imageLiteral(resourceName: "twitter_sharing_image"))
let tweetTitle = NSLocalizedString("SHARE_ACTION_TWEET", comment:"action sheet item")
return UIAlertAction(title: tweetTitle, style: .default) { action in
return UIAlertAction(title: tweetTitle, style: .default) { _ in
Logger.debug("\(self.TAG) Chose tweet")
self.presentingViewController.present(twitterViewController, animated: true, completion: nil)
@ -80,7 +81,7 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
}
func dismissAction() -> UIAlertAction {
return UIAlertAction(title: NSLocalizedString("DISMISS_BUTTON_TEXT", comment:""), style: .cancel)
return UIAlertAction(title: CommonStrings.dismissButton, style: .cancel)
}
// MARK: ContactsPickerDelegate
@ -134,10 +135,10 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
}
let messageTitle = NSLocalizedString("SHARE_ACTION_MESSAGE", comment: "action sheet item to open native messages app")
return UIAlertAction(title: messageTitle, style: .default) { action in
return UIAlertAction(title: messageTitle, style: .default) { _ in
Logger.debug("\(self.TAG) Chose message.")
self.channel = .message
let picker = ContactsPicker(delegate: self, multiSelection: true, subtitleCellType: .phoneNumber)
let picker = ContactsPicker(delegate: self, multiSelection: true, subtitleCellType: .phoneNumber)
let navigationController = UINavigationController(rootViewController: picker)
self.presentingViewController.present(navigationController, animated: true)
}
@ -173,7 +174,7 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
switch result {
case .failed:
let warning = UIAlertController(title: nil, message: NSLocalizedString("SEND_INVITE_FAILURE", comment:"Alert body after invite failed"), preferredStyle: .alert)
warning.addAction(UIAlertAction(title: NSLocalizedString("DISMISS_BUTTON_TEXT", comment:""), style: .default, handler: nil))
warning.addAction(UIAlertAction(title: CommonStrings.dismissButton, style: .default, handler: nil))
self.presentingViewController.present(warning, animated: true, completion: nil)
case .sent:
Logger.debug("\(self.TAG) user successfully invited their friends via SMS.")
@ -192,7 +193,7 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
}
let mailActionTitle = NSLocalizedString("SHARE_ACTION_MAIL", comment: "action sheet item to open native mail app")
return UIAlertAction(title: mailActionTitle, style: .default) { action in
return UIAlertAction(title: mailActionTitle, style: .default) { _ in
Logger.debug("\(self.TAG) Chose mail.")
self.channel = .mail
@ -216,8 +217,8 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
mailComposeViewController.setMessageBody(body, isHTML: false)
self.presentingViewController.dismiss(animated: true) {
self.presentingViewController.navigationController?.present(mailComposeViewController, animated:true) {
UIUtil.applySignalAppearence();
self.presentingViewController.navigationController?.present(mailComposeViewController, animated:true) {
UIUtil.applySignalAppearence()
}
}
}
@ -230,7 +231,7 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
switch result {
case .failed:
let warning = UIAlertController(title: nil, message: NSLocalizedString("SEND_INVITE_FAILURE", comment:"Alert body after invite failed"), preferredStyle: .alert)
warning.addAction(UIAlertAction(title: NSLocalizedString("DISMISS_BUTTON_TEXT", comment:""), style: .default, handler: nil))
warning.addAction(UIAlertAction(title: CommonStrings.dismissButton, style: .default, handler: nil))
self.presentingViewController.present(warning, animated: true, completion: nil)
case .sent:
Logger.debug("\(self.TAG) user successfully invited their friends via mail.")

@ -5,6 +5,7 @@
#import "OWSLinkedDevicesTableViewController.h"
#import "OWSDeviceTableViewCell.h"
#import "OWSLinkDeviceViewController.h"
#import "Signal-Swift.h"
#import "UIViewController+CameraPermissions.h"
#import <SignalServiceKit/NSTimer+OWS.h>
#import <SignalServiceKit/OWSDevice.h>
@ -166,10 +167,9 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1;
}];
[alertController addAction:retryAction];
NSString *dismissTitle
= NSLocalizedString(@"DISMISS_BUTTON_TEXT", @"Generic short text for button to dismiss a dialog");
UIAlertAction *dismissAction =
[UIAlertAction actionWithTitle:dismissTitle style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:CommonStrings.dismissButton
style:UIAlertActionStyleCancel
handler:nil];
[alertController addAction:dismissAction];
dispatch_async(dispatch_get_main_queue(), ^{

@ -379,8 +379,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
- (void)presentInvalidCountryCodeError {
[OWSAlerts showAlertWithTitle:NSLocalizedString(@"REGISTER_CC_ERR_ALERT_VIEW_TITLE", @"")
message:NSLocalizedString(@"REGISTER_CC_ERR_ALERT_VIEW_MESSAGE", @"")
buttonTitle:NSLocalizedString(
@"DISMISS_BUTTON_TEXT", @"Generic short text for button to dismiss a dialog")];
buttonTitle:CommonStrings.dismissButton];
}
#pragma mark - CountryCodeViewControllerDelegate

@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
}];
[alert addAction:openSettingsAction];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"DISMISS_BUTTON_TEXT", nil)
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:CommonStrings.dismissButton
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action) {
failureCallback();

@ -12,8 +12,7 @@ import Foundation
let alertTitle = NSLocalizedString("CALL_AUDIO_PERMISSION_TITLE", comment:"Alert title when calling and permissions for microphone are missing")
let alertMessage = NSLocalizedString("CALL_AUDIO_PERMISSION_MESSAGE", comment:"Alert message when calling and permissions for microphone are missing")
let alertController = UIAlertController(title: alertTitle, message: alertMessage, preferredStyle: .alert)
let dismiss = NSLocalizedString("DISMISS_BUTTON_TEXT", comment: "Generic short text for button to dismiss a dialog")
let dismissAction = UIAlertAction(title: dismiss, style: .cancel)
let dismissAction = UIAlertAction(title: CommonStrings.dismissButton, style: .cancel)
let settingsString = NSLocalizedString("OPEN_SETTINGS_BUTTON", comment: "Button text which opens the settings app")
let settingsAction = UIAlertAction(title: settingsString, style: .default) { _ in
UIApplication.shared.openSystemSettings()

@ -379,8 +379,7 @@
/* Accessibility label for disappearing messages */
"DISAPPEARING_MESSAGES_LABEL" = "Disappearing messages settings";
/* Generic short text for button to dismiss a dialog
Short text to dismiss current modal / actionsheet / screen */
/* Short text to dismiss current modal / actionsheet / screen */
"DISMISS_BUTTON_TEXT" = "Dismiss";
/* Section title for the 'domain fronting country' view. */

Loading…
Cancel
Save