Skip to content

Commit 23f8224

Browse files
Merge pull request #1316 from firebase/update-strings
2 parents 7dbf7a1 + aef42d2 commit 23f8224

File tree

8 files changed

+32550
-44823
lines changed

8 files changed

+32550
-44823
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Strings/Localizable.xcstrings

Lines changed: 32396 additions & 44805 deletions
Large diffs are not rendered by default.

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Utils/StringUtils.swift

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,4 +964,140 @@ public class StringUtils {
964964
public var changeNumberButtonLabel: String {
965965
return localizedString(for: "Change number")
966966
}
967+
968+
// MARK: - Reauthentication Strings
969+
970+
/// Confirm password title
971+
/// found in:
972+
/// - EmailReauthView
973+
public var confirmPasswordTitle: String {
974+
return localizedString(for: "Confirm Password")
975+
}
976+
977+
/// For security prompt message
978+
/// found in:
979+
/// - EmailReauthView
980+
public var forSecurityEnterPasswordMessage: String {
981+
return localizedString(for: "For security, please enter your password")
982+
}
983+
984+
/// Email prefix format
985+
/// found in:
986+
/// - EmailReauthView
987+
public func emailPrefix(email: String) -> String {
988+
return String(format: localizedString(for: "Email: %@"), email)
989+
}
990+
991+
/// Confirm button label
992+
/// found in:
993+
/// - EmailReauthView
994+
public var confirmButtonLabel: String {
995+
return localizedString(for: "Confirm")
996+
}
997+
998+
/// Verify phone number title
999+
/// found in:
1000+
/// - PhoneReauthView
1001+
public var verifyPhoneNumberTitle: String {
1002+
return localizedString(for: "Verify Phone Number")
1003+
}
1004+
1005+
/// For security verify phone message
1006+
/// found in:
1007+
/// - PhoneReauthView
1008+
public var forSecurityVerifyPhoneMessage: String {
1009+
return localizedString(for: "For security, please verify your phone number")
1010+
}
1011+
1012+
/// Send verification code to phone prefix
1013+
/// found in:
1014+
/// - PhoneReauthView
1015+
public var sendVerificationCodeToPhonePrefix: String {
1016+
return localizedString(for: "We'll send a verification code to:")
1017+
}
1018+
1019+
/// Send verification code button label
1020+
/// found in:
1021+
/// - PhoneReauthView
1022+
public var sendVerificationCodeButtonLabel: String {
1023+
return localizedString(for: "Send Verification Code")
1024+
}
1025+
1026+
/// Enter 6-digit code sent to prefix
1027+
/// found in:
1028+
/// - PhoneReauthView
1029+
public var enterSixDigitCodeSentToPrefix: String {
1030+
return localizedString(for: "Enter the 6-digit code sent to:")
1031+
}
1032+
1033+
/// Verify button label
1034+
/// found in:
1035+
/// - PhoneReauthView
1036+
public var verifyButtonLabel: String {
1037+
return localizedString(for: "Verify")
1038+
}
1039+
1040+
// MARK: - Password Update Strings
1041+
1042+
/// Type new password label
1043+
/// found in:
1044+
/// - UpdatePasswordView
1045+
public var typeNewPasswordLabel: String {
1046+
return localizedString(for: "Type new password")
1047+
}
1048+
1049+
/// Retype new password label
1050+
/// found in:
1051+
/// - UpdatePasswordView
1052+
public var retypeNewPasswordLabel: String {
1053+
return localizedString(for: "Retype new password")
1054+
}
1055+
1056+
/// Password updated title
1057+
/// found in:
1058+
/// - UpdatePasswordView
1059+
public var passwordUpdatedTitle: String {
1060+
return localizedString(for: "Password Updated")
1061+
}
1062+
1063+
/// Password updated successfully message
1064+
/// found in:
1065+
/// - UpdatePasswordView
1066+
public var passwordUpdatedSuccessMessage: String {
1067+
return localizedString(for: "Your password has been successfully updated.")
1068+
}
1069+
1070+
// MARK: - MFA Management Strings
1071+
1072+
/// Unnamed method fallback label
1073+
/// found in:
1074+
/// - MFAManagementView
1075+
public var unnamedMethodLabel: String {
1076+
return localizedString(for: "Unnamed Method")
1077+
}
1078+
1079+
/// Account prefix for TOTP display name
1080+
/// found in:
1081+
/// - MFAResolutionView
1082+
public func accountPrefix(displayName: String) -> String {
1083+
return String(format: localizedString(for: "Account: %@"), displayName)
1084+
}
1085+
1086+
// MARK: - Email Verification Strings
1087+
1088+
/// Email verification tap link message
1089+
/// found in:
1090+
/// - SignedInView
1091+
public var emailVerificationTapLinkMessage: String {
1092+
return localizedString(for: "Please tap on the link in your email to complete verification.")
1093+
}
1094+
1095+
// MARK: - Privacy/TOC Format Strings
1096+
1097+
/// Footer terms format (simple concatenation for footer mode)
1098+
/// found in:
1099+
/// - PrivacyTOCsView
1100+
public var footerTermsFormat: String {
1101+
return "%@ %@"
1102+
}
9671103
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/EmailReauthView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ extension EmailReauthView: View {
6565
.font(.system(size: 60))
6666
.foregroundColor(.blue)
6767

68-
Text("Confirm Password")
68+
Text(authService.string.confirmPasswordTitle)
6969
.font(.title)
7070
.fontWeight(.bold)
7171

72-
Text("For security, please enter your password")
72+
Text(authService.string.forSecurityEnterPasswordMessage)
7373
.font(.body)
7474
.foregroundColor(.secondary)
7575
.multilineTextAlignment(.center)
7676
}
7777
.padding()
7878

7979
VStack(spacing: 20) {
80-
Text("Email: \(email)")
80+
Text(authService.string.emailPrefix(email: email))
8181
.font(.caption)
8282
.frame(maxWidth: .infinity, alignment: .leading)
8383
.padding(.bottom, 8)
@@ -104,7 +104,7 @@ extension EmailReauthView: View {
104104
.frame(height: 32)
105105
.frame(maxWidth: .infinity)
106106
} else {
107-
Text("Confirm")
107+
Text(authService.string.confirmButtonLabel)
108108
.frame(height: 32)
109109
.frame(maxWidth: .infinity)
110110
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/MFAManagementView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ extension MFAManagementView: View {
159159
.font(.title2)
160160

161161
VStack(alignment: .leading, spacing: 4) {
162-
Text(factor.displayName ?? "Unnamed Method")
162+
Text(factor.displayName ?? authService.string.unnamedMethodLabel)
163163
.font(.headline)
164164

165165
if factor.factorID == PhoneMultiFactorID {

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/MFAResolutionView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ extension MFAResolutionView: View {
259259
.multilineTextAlignment(.center)
260260

261261
if let displayName = displayName {
262-
Text("Account: \(displayName)")
262+
Text(authService.string.accountPrefix(displayName: displayName))
263263
.font(.caption)
264264
.foregroundColor(.secondary)
265265
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/PhoneReauthView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ extension PhoneReauthView: View {
9090
.font(.system(size: 60))
9191
.foregroundColor(.blue)
9292

93-
Text("Verify Phone Number")
93+
Text(authService.string.verifyPhoneNumberTitle)
9494
.font(.title)
9595
.fontWeight(.bold)
9696

97-
Text("For security, please verify your phone number")
97+
Text(authService.string.forSecurityVerifyPhoneMessage)
9898
.font(.body)
9999
.foregroundColor(.secondary)
100100
.multilineTextAlignment(.center)
@@ -104,7 +104,7 @@ extension PhoneReauthView: View {
104104
if verificationID == nil {
105105
// Initial state - sending SMS
106106
VStack(spacing: 20) {
107-
Text("We'll send a verification code to:")
107+
Text(authService.string.sendVerificationCodeToPhonePrefix)
108108
.font(.subheadline)
109109
.foregroundStyle(.secondary)
110110
.frame(maxWidth: .infinity, alignment: .leading)
@@ -122,7 +122,7 @@ extension PhoneReauthView: View {
122122
.frame(height: 32)
123123
.frame(maxWidth: .infinity)
124124
} else {
125-
Text("Send Verification Code")
125+
Text(authService.string.sendVerificationCodeButtonLabel)
126126
.frame(height: 32)
127127
.frame(maxWidth: .infinity)
128128
}
@@ -138,7 +138,7 @@ extension PhoneReauthView: View {
138138
} else {
139139
// Enter verification code
140140
VStack(spacing: 20) {
141-
Text("Enter the 6-digit code sent to:")
141+
Text(authService.string.enterSixDigitCodeSentToPrefix)
142142
.font(.subheadline)
143143
.foregroundStyle(.secondary)
144144
.frame(maxWidth: .infinity, alignment: .leading)
@@ -165,7 +165,7 @@ extension PhoneReauthView: View {
165165
.frame(height: 32)
166166
.frame(maxWidth: .infinity)
167167
} else {
168-
Text("Verify")
168+
Text(authService.string.verifyButtonLabel)
169169
.frame(height: 32)
170170
.frame(maxWidth: .infinity)
171171
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/SignedInView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ extension SignedInView: View {
7878
Button {
7979
authService.navigator.push(.mfaManagement)
8080
} label: {
81-
Text("Manage Two-Factor Authentication")
81+
Text(authService.string.manageTwoFactorAuthenticationLabel)
8282
.padding(.vertical, 8)
8383
.frame(maxWidth: .infinity)
8484
}
@@ -158,7 +158,7 @@ extension SignedInView: View {
158158
showEmailVerificationSent = false
159159
}
160160
} message: {
161-
Text("Please tap on the link in your email to complete verification.")
161+
Text(authService.string.emailVerificationTapLinkMessage)
162162
}
163163
}
164164
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/UpdatePasswordView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extension UpdatePasswordView: View {
6262
VStack(spacing: 24) {
6363
AuthTextField(
6464
text: $password,
65-
label: "Type new password",
65+
label: authService.string.typeNewPasswordLabel,
6666
prompt: authService.string.passwordInputLabel,
6767
contentType: .password,
6868
isSecureTextField: true,
@@ -79,7 +79,7 @@ extension UpdatePasswordView: View {
7979

8080
AuthTextField(
8181
text: $confirmPassword,
82-
label: "Retype new password",
82+
label: authService.string.retypeNewPasswordLabel,
8383
prompt: authService.string.confirmPasswordInputLabel,
8484
contentType: .password,
8585
isSecureTextField: true,
@@ -111,15 +111,15 @@ extension UpdatePasswordView: View {
111111
.navigationTitle(authService.string.updatePasswordTitle)
112112
.withReauthentication(coordinator: reauthCoordinator)
113113
.alert(
114-
"Password Updated",
114+
authService.string.passwordUpdatedTitle,
115115
isPresented: $showAlert
116116
) {
117117
Button(authService.string.okButtonLabel) {
118118
showAlert = false
119119
authService.navigator.clear()
120120
}
121121
} message: {
122-
Text("Your password has been successfully updated.")
122+
Text(authService.string.passwordUpdatedSuccessMessage)
123123
}
124124
}
125125
}

0 commit comments

Comments
 (0)