Skip to content

Commit

Permalink
Replace old strings with new strings in some views
Browse files Browse the repository at this point in the history
This time, strings in screen sharing, alert, call, and survey mocks were
changed. Also a string that was previously missing was added.

MOB-2538
  • Loading branch information
gersonnoboa committed Aug 23, 2023
1 parent b689b65 commit d09b236
Show file tree
Hide file tree
Showing 14 changed files with 137 additions and 156 deletions.
16 changes: 8 additions & 8 deletions GliaWidgets/L10n.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ public enum L10n {
}
}
public enum Call {
/// You can continue browsing and we’ll connect you automatically.
public static let bottomText = L10n.tr("Deprecated", "call.bottomText", fallback: "You can continue browsing and we’ll connect you automatically.")
/// You can continue browsing and we will connect you automatically.
public static let bottomText = L10n.tr("Deprecated", "call.bottomText", fallback: "You can continue browsing and we will connect you automatically.")
/// (By default your video will be off)
public static let topText = L10n.tr("Deprecated", "call.topText", fallback: "(By default your video will be off)")
public enum Accessibility {
Expand Down Expand Up @@ -401,8 +401,8 @@ public enum L10n {
public enum Queue {
/// CompanyName
public static let firstText = L10n.tr("Deprecated", "call.connect.queue.firstText", fallback: "CompanyName")
/// We're here to help!
public static let secondText = L10n.tr("Deprecated", "call.connect.queue.secondText", fallback: "We're here to help!")
/// We are here to help!
public static let secondText = L10n.tr("Deprecated", "call.connect.queue.secondText", fallback: "We are here to help!")
}
public enum Transferring {
/// Transferring
Expand Down Expand Up @@ -645,8 +645,8 @@ public enum L10n {
public enum Queue {
/// CompanyName
public static let firstText = L10n.tr("Deprecated", "chat.connect.queue.firstText", fallback: "CompanyName")
/// We're here to help!
public static let secondText = L10n.tr("Deprecated", "chat.connect.queue.secondText", fallback: "We're here to help!")
/// We are here to help!
public static let secondText = L10n.tr("Deprecated", "chat.connect.queue.secondText", fallback: "We are here to help!")
}
public enum Transferring {
/// Transferring
Expand Down Expand Up @@ -869,8 +869,8 @@ public enum L10n {
}
public enum Question {
public enum Title {
/// *
public static let asterisk = L10n.tr("Deprecated", "survey.question.title.asterisk", fallback: " *")
/// *
public static let asterisk = L10n.tr("Deprecated", "survey.question.title.asterisk", fallback: "*")
}
}
}
Expand Down
20 changes: 14 additions & 6 deletions GliaWidgets/Localization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ internal enum Localization {
/// {operatorName} has offered you to upgrade
internal static let offerUpgrade = Localization.tr("Localizable", "engagement.offer_upgrade", fallback: "{operatorName} has offered you to upgrade")
internal enum Connect {
/// We are here to help
internal static let placeholder = Localization.tr("Localizable", "engagement.connect.placeholder", fallback: "We are here to help")
/// We are here to help!
internal static let placeholder = Localization.tr("Localizable", "engagement.connect.placeholder", fallback: "We are here to help!")
/// Connecting with {operatorName}
internal static let with = Localization.tr("Localizable", "engagement.connect.with", fallback: "Connecting with {operatorName}")
}
Expand Down Expand Up @@ -308,6 +308,8 @@ internal enum Localization {
internal enum QueueWait {
/// You can continue browsing and we will connect you automatically.
internal static let message = Localization.tr("Localizable", "engagement.queue_wait.message", fallback: "You can continue browsing and we will connect you automatically.")
/// (By default your video will be off)
internal static let videoNotice = Localization.tr("Localizable", "engagement.queue_wait.video_notice", fallback: "(By default your video will be off)")
}
internal enum SecureMessaging {
/// Messaging
Expand Down Expand Up @@ -353,8 +355,8 @@ internal enum Localization {
internal static let ok = Localization.tr("Localizable", "general.ok", fallback: "Ok")
/// Open
internal static let `open` = Localization.tr("Localizable", "general.open", fallback: "Open")
/// Powered by Glia
internal static let poweredBy = Localization.tr("Localizable", "general.powered_by", fallback: "Powered by Glia")
/// Powered by
internal static let poweredBy = Localization.tr("Localizable", "general.powered_by", fallback: "Powered by")
/// Retry
internal static let retry = Localization.tr("Localizable", "general.retry", fallback: "Retry")
/// Selected
Expand Down Expand Up @@ -454,12 +456,18 @@ internal enum Localization {
}
internal enum ScreenSharing {
internal enum VisitorScreen {
/// End screen sharing
internal static let end = Localization.tr("Localizable", "screen_sharing.visitor_screen.end", fallback: "End screen sharing")
/// End Screen Sharing
internal static let end = Localization.tr("Localizable", "screen_sharing.visitor_screen.end", fallback: "End Screen Sharing")
internal enum Disclaimer {
/// You are about to share your screen
internal static let title = Localization.tr("Localizable", "screen_sharing.visitor_screen.disclaimer.title", fallback: "You are about to share your screen")
}
internal enum End {
internal enum Accessibility {
/// Ends screen sharing
internal static let hint = Localization.tr("Localizable", "screen_sharing.visitor_screen.end.accessibility.hint", fallback: "Ends screen sharing")
}
}
}
}
internal enum Screensharing {
Expand Down
2 changes: 1 addition & 1 deletion GliaWidgets/Public/Configuration/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public struct Configuration {
visitorContext: VisitorContext? = nil,
pushNotifications: PushNotifications = .disabled,
isWhiteLabelApp: Bool = false,
companyName: String = L10n.Chat.Connect.Queue.firstText
companyName: String = ""
) {
self.authorizationMethod = authorizationMethod
self.environment = environment
Expand Down
8 changes: 4 additions & 4 deletions GliaWidgets/Resources/en.lproj/Deprecated.strings
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"chat.title" = "Chat";
"chat.endButton.title" = "End";
"chat.connect.queue.firstText" = "CompanyName";
"chat.connect.queue.secondText" = "We're here to help!";
"chat.connect.queue.secondText" = "We are here to help!";
"chat.connect.connecting.firstText" = "Connecting with {operatorName}";
"chat.connect.connecting.secondText" = "";
"chat.connect.connected.firstText" = "{operatorName}";
Expand Down Expand Up @@ -143,15 +143,15 @@
"call.video.title" = "Video";
"call.endButton.title" = "End";
"call.connect.queue.firstText" = "CompanyName";
"call.connect.queue.secondText" = "We're here to help!";
"call.connect.queue.secondText" = "We are here to help!";
"call.connect.connecting.firstText" = "Connecting with {operatorName}";
"call.connect.connecting.secondText" = "";
"call.connect.connected.firstText" = "{operatorName}";
"call.connect.connected.secondText" = "{callDuration}";
"call.connect.transferring.firstText" = "Transferring";
"call.operator.name" = "{operatorName}";
"call.topText" = "(By default your video will be off)";
"call.bottomText" = "You can continue browsing and we’ll connect you automatically.";
"call.bottomText" = "You can continue browsing and we will connect you automatically.";
"call.buttons.chat.title" = "Chat";
"call.buttons.video.title" = "Video";
"call.buttons.mute.inactive.title" = "Mute";
Expand Down Expand Up @@ -214,7 +214,7 @@
"survey.action.yes" = "Yes";
"survey.action.no" = "No";
"survey.action.validationError" = "Please provide an answer.";
"survey.question.title.asterisk" = " *";
"survey.question.title.asterisk" = "*";

"survey.accessibility.footer.cancelButton.label" = "Cancel";
"survey.accessibility.footer.submitButton.label" = "Submit";
Expand Down
8 changes: 5 additions & 3 deletions GliaWidgets/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"chat.upgrade.audio.text" = "Upgraded to Audio Call";
"chat.upgrade.video.text" = "Upgraded to Video Call";
"chat.upload.remove.accessibility.label" = "Remove upload";
"engagement.connect.placeholder" = "We are here to help";
"engagement.connect.placeholder" = "We are here to help!";
"engagement.connect.with" = "Connecting with {operatorName}";
"engagement.default_operator_name" = "Operator";
"engagement.end.confirmation.header" = "End Engagement?";
Expand All @@ -140,6 +140,7 @@
"engagement.queue_leave.message" = "You will lose your place in the queue.";
"engagement.queue_reconnection_failed.try_again" = "Please try again.";
"engagement.queue_transferring.message" = "Transferring";
"engagement.queue_wait.video_notice" = "(By default your video will be off)";
"engagement.queue_wait.message" = "You can continue browsing and we will connect you automatically.";
"engagement.secure_messaging.title" = "Messaging";
"error.general" = "Something went wrong";
Expand All @@ -159,7 +160,7 @@
"general.no" = "No";
"general.ok" = "Ok";
"general.open" = "Open";
"general.powered_by" = "Powered by Glia";
"general.powered_by" = "Powered by";
"general.retry" = "Retry";
"general.selected" = "Selected";
"general.submit" = "Submit";
Expand Down Expand Up @@ -189,7 +190,8 @@
"message_center.welcome.send.accessibility.hint" = "Sends a secure message.";
"message_center.welcome.title" = "Welcome to Message Center";
"screen_sharing.visitor_screen.disclaimer.title" = "You are about to share your screen";
"screen_sharing.visitor_screen.end" = "End screen sharing";
"screen_sharing.visitor_screen.end" = "End Screen Sharing";
"screen_sharing.visitor_screen.end.accessibility.hint" = "Ends screen sharing";
"screensharing.visitor_screen.disclaimer.info" = "Depending on your selection, your entire screen might be shared with the operator, not just the application window.";
"send_message.send" = "Send message";
"send_message.sending" = "Sending…";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ extension CallVisualizer {
$0.numberOfLines = 2
$0.textAlignment = .center
$0.accessibilityIdentifier = "end_screen_sharing_message"
$0.accessibilityHint = L10n.CallVisualizer.ScreenSharing.Accessibility.messageHint
$0.accessibilityHint = Localization.CallVisualizer.ScreenSharing.Message.Accessibility.hint
}
private lazy var endScreenSharingButton = ActionButton(props: props.endScreenSharing).make {
$0.setImage(props.style.buttonIcon, for: .normal)
$0.tintColor = props.style.buttonStyle.titleColor
$0.titleEdgeInsets = .init(top: 0, left: 8, bottom: 0, right: 0)
$0.accessibilityIdentifier = "end_screen_sharing_button"
$0.accessibilityLabel = L10n.CallVisualizer.ScreenSharing.Accessibility.buttonLabel
$0.accessibilityHint = L10n.CallVisualizer.ScreenSharing.Accessibility.buttonHint
$0.accessibilityLabel = Localization.ScreenSharing.VisitorScreen.end
$0.accessibilityHint = Localization.ScreenSharing.VisitorScreen.End.Accessibility.hint
}
private lazy var contentStackView = UIStackView.make(
.vertical,
Expand Down
2 changes: 1 addition & 1 deletion GliaWidgets/Sources/Extensions/String+TemplateString.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extension String {
func withOperatorName(_ name: String?) -> String {
let name = name ?? L10n.operator
let name = name ?? Localization.Engagement.defaultOperatorName
return replacingOccurrences(of: "{operatorName}", with: name)
}

Expand Down
13 changes: 5 additions & 8 deletions GliaWidgets/Sources/Theme/Theme+Alert.swift
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
extension Theme {
var alertStyle: AlertStyle {
typealias Alert = L10n.Alert
typealias Accessibility = Alert.Accessibility

let negativeAction = ActionButtonStyle(
title: Alert.Action.no,
title: Localization.General.no,
titleFont: font.buttonLabel,
titleColor: color.baseLight,
backgroundColor: .fill(color: color.systemNegative),
accessibility: .init(
label: Accessibility.Action.no,
label: Localization.General.no,
isFontScalingEnabled: true
)
)
let positiveAction = ActionButtonStyle(
title: Alert.Action.yes,
title: Localization.General.yes,
titleFont: font.buttonLabel,
titleColor: color.baseLight,
backgroundColor: .fill(color: color.primary),
accessibility: .init(
label: Accessibility.Action.yes,
label: Localization.General.yes,
isFontScalingEnabled: true
)
)
let poweredBy = PoweredByStyle(
text: L10n.poweredBy,
text: Localization.General.poweredBy,
font: font.caption,
accessibility: .init(isFontScalingEnabled: true)
)
Expand Down
Loading

0 comments on commit d09b236

Please sign in to comment.