Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77,201 changes: 32,396 additions & 44,805 deletions FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Strings/Localizable.xcstrings

Large diffs are not rendered by default.

136 changes: 136 additions & 0 deletions FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Utils/StringUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -964,4 +964,140 @@ public class StringUtils {
public var changeNumberButtonLabel: String {
return localizedString(for: "Change number")
}

// MARK: - Reauthentication Strings

/// Confirm password title
/// found in:
/// - EmailReauthView
public var confirmPasswordTitle: String {
return localizedString(for: "Confirm Password")
}

/// For security prompt message
/// found in:
/// - EmailReauthView
public var forSecurityEnterPasswordMessage: String {
return localizedString(for: "For security, please enter your password")
}

/// Email prefix format
/// found in:
/// - EmailReauthView
public func emailPrefix(email: String) -> String {
return String(format: localizedString(for: "Email: %@"), email)
}

/// Confirm button label
/// found in:
/// - EmailReauthView
public var confirmButtonLabel: String {
return localizedString(for: "Confirm")
}

/// Verify phone number title
/// found in:
/// - PhoneReauthView
public var verifyPhoneNumberTitle: String {
return localizedString(for: "Verify Phone Number")
}

/// For security verify phone message
/// found in:
/// - PhoneReauthView
public var forSecurityVerifyPhoneMessage: String {
return localizedString(for: "For security, please verify your phone number")
}

/// Send verification code to phone prefix
/// found in:
/// - PhoneReauthView
public var sendVerificationCodeToPhonePrefix: String {
return localizedString(for: "We'll send a verification code to:")
}

/// Send verification code button label
/// found in:
/// - PhoneReauthView
public var sendVerificationCodeButtonLabel: String {
return localizedString(for: "Send Verification Code")
}

/// Enter 6-digit code sent to prefix
/// found in:
/// - PhoneReauthView
public var enterSixDigitCodeSentToPrefix: String {
return localizedString(for: "Enter the 6-digit code sent to:")
}

/// Verify button label
/// found in:
/// - PhoneReauthView
public var verifyButtonLabel: String {
return localizedString(for: "Verify")
}

// MARK: - Password Update Strings

/// Type new password label
/// found in:
/// - UpdatePasswordView
public var typeNewPasswordLabel: String {
return localizedString(for: "Type new password")
}

/// Retype new password label
/// found in:
/// - UpdatePasswordView
public var retypeNewPasswordLabel: String {
return localizedString(for: "Retype new password")
}

/// Password updated title
/// found in:
/// - UpdatePasswordView
public var passwordUpdatedTitle: String {
return localizedString(for: "Password Updated")
}

/// Password updated successfully message
/// found in:
/// - UpdatePasswordView
public var passwordUpdatedSuccessMessage: String {
return localizedString(for: "Your password has been successfully updated.")
}

// MARK: - MFA Management Strings

/// Unnamed method fallback label
/// found in:
/// - MFAManagementView
public var unnamedMethodLabel: String {
return localizedString(for: "Unnamed Method")
}

/// Account prefix for TOTP display name
/// found in:
/// - MFAResolutionView
public func accountPrefix(displayName: String) -> String {
return String(format: localizedString(for: "Account: %@"), displayName)
}

// MARK: - Email Verification Strings

/// Email verification tap link message
/// found in:
/// - SignedInView
public var emailVerificationTapLinkMessage: String {
return localizedString(for: "Please tap on the link in your email to complete verification.")
}

// MARK: - Privacy/TOC Format Strings

/// Footer terms format (simple concatenation for footer mode)
/// found in:
/// - PrivacyTOCsView
public var footerTermsFormat: String {
return "%@ %@"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ extension EmailReauthView: View {
.font(.system(size: 60))
.foregroundColor(.blue)

Text("Confirm Password")
Text(authService.string.confirmPasswordTitle)
.font(.title)
.fontWeight(.bold)

Text("For security, please enter your password")
Text(authService.string.forSecurityEnterPasswordMessage)
.font(.body)
.foregroundColor(.secondary)
.multilineTextAlignment(.center)
}
.padding()

VStack(spacing: 20) {
Text("Email: \(email)")
Text(authService.string.emailPrefix(email: email))
.font(.caption)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.bottom, 8)
Expand All @@ -104,7 +104,7 @@ extension EmailReauthView: View {
.frame(height: 32)
.frame(maxWidth: .infinity)
} else {
Text("Confirm")
Text(authService.string.confirmButtonLabel)
.frame(height: 32)
.frame(maxWidth: .infinity)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ extension MFAManagementView: View {
.font(.title2)

VStack(alignment: .leading, spacing: 4) {
Text(factor.displayName ?? "Unnamed Method")
Text(factor.displayName ?? authService.string.unnamedMethodLabel)
.font(.headline)

if factor.factorID == PhoneMultiFactorID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ extension MFAResolutionView: View {
.multilineTextAlignment(.center)

if let displayName = displayName {
Text("Account: \(displayName)")
Text(authService.string.accountPrefix(displayName: displayName))
.font(.caption)
.foregroundColor(.secondary)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ extension PhoneReauthView: View {
.font(.system(size: 60))
.foregroundColor(.blue)

Text("Verify Phone Number")
Text(authService.string.verifyPhoneNumberTitle)
.font(.title)
.fontWeight(.bold)

Text("For security, please verify your phone number")
Text(authService.string.forSecurityVerifyPhoneMessage)
.font(.body)
.foregroundColor(.secondary)
.multilineTextAlignment(.center)
Expand All @@ -104,7 +104,7 @@ extension PhoneReauthView: View {
if verificationID == nil {
// Initial state - sending SMS
VStack(spacing: 20) {
Text("We'll send a verification code to:")
Text(authService.string.sendVerificationCodeToPhonePrefix)
.font(.subheadline)
.foregroundStyle(.secondary)
.frame(maxWidth: .infinity, alignment: .leading)
Expand All @@ -122,7 +122,7 @@ extension PhoneReauthView: View {
.frame(height: 32)
.frame(maxWidth: .infinity)
} else {
Text("Send Verification Code")
Text(authService.string.sendVerificationCodeButtonLabel)
.frame(height: 32)
.frame(maxWidth: .infinity)
}
Expand All @@ -138,7 +138,7 @@ extension PhoneReauthView: View {
} else {
// Enter verification code
VStack(spacing: 20) {
Text("Enter the 6-digit code sent to:")
Text(authService.string.enterSixDigitCodeSentToPrefix)
.font(.subheadline)
.foregroundStyle(.secondary)
.frame(maxWidth: .infinity, alignment: .leading)
Expand All @@ -165,7 +165,7 @@ extension PhoneReauthView: View {
.frame(height: 32)
.frame(maxWidth: .infinity)
} else {
Text("Verify")
Text(authService.string.verifyButtonLabel)
.frame(height: 32)
.frame(maxWidth: .infinity)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ extension SignedInView: View {
Button {
authService.navigator.push(.mfaManagement)
} label: {
Text("Manage Two-Factor Authentication")
Text(authService.string.manageTwoFactorAuthenticationLabel)
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
}
Expand Down Expand Up @@ -158,7 +158,7 @@ extension SignedInView: View {
showEmailVerificationSent = false
}
} message: {
Text("Please tap on the link in your email to complete verification.")
Text(authService.string.emailVerificationTapLinkMessage)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extension UpdatePasswordView: View {
VStack(spacing: 24) {
AuthTextField(
text: $password,
label: "Type new password",
label: authService.string.typeNewPasswordLabel,
prompt: authService.string.passwordInputLabel,
contentType: .password,
isSecureTextField: true,
Expand All @@ -79,7 +79,7 @@ extension UpdatePasswordView: View {

AuthTextField(
text: $confirmPassword,
label: "Retype new password",
label: authService.string.retypeNewPasswordLabel,
prompt: authService.string.confirmPasswordInputLabel,
contentType: .password,
isSecureTextField: true,
Expand Down Expand Up @@ -111,15 +111,15 @@ extension UpdatePasswordView: View {
.navigationTitle(authService.string.updatePasswordTitle)
.withReauthentication(coordinator: reauthCoordinator)
.alert(
"Password Updated",
authService.string.passwordUpdatedTitle,
isPresented: $showAlert
) {
Button(authService.string.okButtonLabel) {
showAlert = false
authService.navigator.clear()
}
} message: {
Text("Your password has been successfully updated.")
Text(authService.string.passwordUpdatedSuccessMessage)
}
}
}
Expand Down
Loading