feat(i18n): 사용자 화면 문구를 I18n 키로 통일한다
This commit is contained in:
@@ -17,11 +17,11 @@ struct FindPasswordView: View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
GeometryReader { proxy in
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: String(localized: "비밀번호 재설정"))
|
||||
DetailNavigationBar(title: I18n.FindPassword.title)
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
VStack(spacing: 0) {
|
||||
Text("회원가입한 이메일 주소로\n임시 비밀번호를 보내드립니다.")
|
||||
Text(I18n.FindPassword.description1)
|
||||
.appFont(size: 16, weight: .bold)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.multilineTextAlignment(.center)
|
||||
@@ -29,7 +29,7 @@ struct FindPasswordView: View {
|
||||
.padding(.top, 40)
|
||||
.padding(.horizontal, 26.7)
|
||||
|
||||
Text("임시 비밀번호로 로그인 후\n마이페이지 > 프로필 설정에서\n비밀번호를 변경하고 이용하세요.")
|
||||
Text(I18n.FindPassword.description2)
|
||||
.appFont(size: 12, weight: .medium)
|
||||
.foregroundColor(Color(hex: "909090"))
|
||||
.multilineTextAlignment(.center)
|
||||
@@ -37,7 +37,7 @@ struct FindPasswordView: View {
|
||||
.padding(.top, 40)
|
||||
.padding(.horizontal, 26.7)
|
||||
|
||||
TextField("이메일을 입력하세요", text: $viewModel.email)
|
||||
TextField(I18n.FindPassword.emailPlaceholder, text: $viewModel.email)
|
||||
.focused($isFocused)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
@@ -54,7 +54,7 @@ struct FindPasswordView: View {
|
||||
isFocused = true
|
||||
}
|
||||
|
||||
Text("임시 비밀번호 받기")
|
||||
Text(I18n.FindPassword.submit)
|
||||
.appFont(size: 18.3, weight: .bold)
|
||||
.foregroundColor(Color.white)
|
||||
.frame(maxWidth: proxy.size.width - 26.7)
|
||||
@@ -67,7 +67,7 @@ struct FindPasswordView: View {
|
||||
HStack(spacing: 13.3) {
|
||||
Image("ic_headphones_blue")
|
||||
|
||||
Text("고객센터로 문의하기")
|
||||
Text(I18n.FindPassword.contactSupport)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(.button)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ final class FindPasswordViewModel: ObservableObject {
|
||||
|
||||
func findPassword() {
|
||||
if email.trimmingCharacters(in: .whitespaces).isEmpty {
|
||||
errorMessage = "이메일을 입력하세요."
|
||||
errorMessage = I18n.FindPassword.emailRequired
|
||||
isShowPopup = true
|
||||
return
|
||||
}
|
||||
@@ -45,7 +45,7 @@ final class FindPasswordViewModel: ObservableObject {
|
||||
|
||||
if decoded.success {
|
||||
self.email = ""
|
||||
self.errorMessage = "임시 비밀번호가 입력하신 이메일로 발송되었습니다.\n이메일을 확인해 주세요."
|
||||
self.errorMessage = I18n.FindPassword.successMessage
|
||||
self.isShowPopup = true
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
AppState.shared.back()
|
||||
@@ -54,13 +54,13 @@ final class FindPasswordViewModel: ObservableObject {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
}
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,11 @@ struct LoginView: View {
|
||||
}
|
||||
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: "로그인")
|
||||
DetailNavigationBar(title: I18n.Login.title)
|
||||
|
||||
Spacer()
|
||||
|
||||
TextField("이메일", text: $viewModel.email)
|
||||
TextField(I18n.User.emailPlaceholder, text: $viewModel.email)
|
||||
.submitLabel(.next)
|
||||
.focused($focusedField, equals: .email)
|
||||
.autocapitalization(.none)
|
||||
@@ -56,9 +56,9 @@ struct LoginView: View {
|
||||
HStack {
|
||||
Group {
|
||||
if isPasswordVisible {
|
||||
TextField("비밀번호", text: $viewModel.password)
|
||||
TextField(I18n.User.passwordPlaceholder, text: $viewModel.password)
|
||||
} else {
|
||||
SecureField("비밀번호", text: $viewModel.password)
|
||||
SecureField(I18n.User.passwordPlaceholder, text: $viewModel.password)
|
||||
}
|
||||
}
|
||||
.submitLabel(.done)
|
||||
@@ -92,7 +92,7 @@ struct LoginView: View {
|
||||
viewModel.login()
|
||||
}
|
||||
) {
|
||||
Text("로그인")
|
||||
Text(I18n.Login.login)
|
||||
.appFont(size: 15, weight: .bold)
|
||||
.frame(width: screenSize().width - 26.6, height: 46.7)
|
||||
.foregroundColor(.white)
|
||||
@@ -101,7 +101,7 @@ struct LoginView: View {
|
||||
}
|
||||
.padding(.top, 40)
|
||||
|
||||
Text("비밀번호를 잊으셨나요?")
|
||||
Text(I18n.Login.forgotPassword)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color.graybb)
|
||||
.padding(.vertical, 10)
|
||||
@@ -111,7 +111,7 @@ struct LoginView: View {
|
||||
}
|
||||
.padding(.top, 30)
|
||||
|
||||
Text("보이스온 회원이 아닌가요? 지금 가입하세요.")
|
||||
Text(I18n.Login.signUpPrompt)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color.graybb)
|
||||
.padding(.vertical, 10)
|
||||
|
||||
@@ -33,13 +33,13 @@ final class LoginViewModel: NSObject, ObservableObject {
|
||||
|
||||
func login() {
|
||||
if email.isEmpty {
|
||||
self.errorMessage = "이메일을 입력해 주세요."
|
||||
self.errorMessage = I18n.User.emailRequired
|
||||
self.isShowPopup = true
|
||||
return
|
||||
}
|
||||
|
||||
if password.isEmpty {
|
||||
self.errorMessage = "비밀번호를 입력해 주세요."
|
||||
self.errorMessage = I18n.User.passwordRequired
|
||||
self.isShowPopup = true
|
||||
return
|
||||
}
|
||||
@@ -309,13 +309,13 @@ final class LoginViewModel: NSObject, ObservableObject {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
}
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
@@ -365,20 +365,20 @@ final class LoginViewModel: NSObject, ObservableObject {
|
||||
extension LoginViewModel: ASAuthorizationControllerDelegate {
|
||||
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
|
||||
guard let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential else {
|
||||
self.errorMessage = "애플 로그인 정보를 가져오지 못했습니다."
|
||||
self.errorMessage = I18n.Login.appleAuthorizationFailed
|
||||
self.isShowPopup = true
|
||||
return
|
||||
}
|
||||
|
||||
guard let identityTokenData = appleIDCredential.identityToken,
|
||||
let identityToken = String(data: identityTokenData, encoding: .utf8) else {
|
||||
self.errorMessage = "애플 인증 토큰을 가져오지 못했습니다."
|
||||
self.errorMessage = I18n.Login.appleTokenMissing
|
||||
self.isShowPopup = true
|
||||
return
|
||||
}
|
||||
|
||||
guard let nonce = currentNonce else {
|
||||
self.errorMessage = "다시 시도해 주세요."
|
||||
self.errorMessage = I18n.Login.appleRetry
|
||||
self.isShowPopup = true
|
||||
return
|
||||
}
|
||||
@@ -389,7 +389,7 @@ extension LoginViewModel: ASAuthorizationControllerDelegate {
|
||||
|
||||
func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
|
||||
ERROR_LOG(error.localizedDescription)
|
||||
self.errorMessage = "애플 로그인에 실패했습니다.\n다시 시도해 주세요."
|
||||
self.errorMessage = I18n.Login.appleSignInFailed
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ struct SignUpView: View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
GeometryReader { proxy in
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: "회원가입")
|
||||
DetailNavigationBar(title: I18n.SignUp.title)
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
VStack(spacing: 0) {
|
||||
TextField("이메일", text: $viewModel.email)
|
||||
TextField(I18n.User.emailPlaceholder, text: $viewModel.email)
|
||||
.submitLabel(.next)
|
||||
.focused($focusedField, equals: .email)
|
||||
.autocapitalization(.none)
|
||||
@@ -51,9 +51,9 @@ struct SignUpView: View {
|
||||
HStack {
|
||||
Group {
|
||||
if isPasswordVisible {
|
||||
TextField("비밀번호", text: $viewModel.password)
|
||||
TextField(I18n.User.passwordPlaceholder, text: $viewModel.password)
|
||||
} else {
|
||||
SecureField("비밀번호", text: $viewModel.password)
|
||||
SecureField(I18n.User.passwordPlaceholder, text: $viewModel.password)
|
||||
}
|
||||
}
|
||||
.submitLabel(.done)
|
||||
@@ -96,11 +96,11 @@ struct SignUpView: View {
|
||||
}
|
||||
|
||||
HStack(spacing: 5) {
|
||||
Text("이용약관")
|
||||
Text(I18n.SignUp.terms)
|
||||
.appFont(size: 12, weight: .medium)
|
||||
.foregroundColor(Color.grayee)
|
||||
|
||||
Text("(필수)")
|
||||
Text(I18n.SignUp.required)
|
||||
.appFont(size: 12, weight: .medium)
|
||||
.foregroundColor(Color.button)
|
||||
}
|
||||
@@ -129,11 +129,11 @@ struct SignUpView: View {
|
||||
}
|
||||
|
||||
HStack(spacing: 5) {
|
||||
Text("개인정보수집 및 이용동의")
|
||||
Text(I18n.SignUp.privacyPolicy)
|
||||
.appFont(size: 12, weight: .medium)
|
||||
.foregroundColor(Color.grayee)
|
||||
|
||||
Text("(필수)")
|
||||
Text(I18n.SignUp.required)
|
||||
.appFont(size: 12, weight: .medium)
|
||||
.foregroundColor(Color.button)
|
||||
}
|
||||
@@ -152,7 +152,7 @@ struct SignUpView: View {
|
||||
.padding(.top, 20)
|
||||
.padding(.horizontal, 13.3)
|
||||
|
||||
Text("회원가입")
|
||||
Text(I18n.SignUp.submit)
|
||||
.appFont(size: 18.3, weight: .bold)
|
||||
.foregroundColor(Color.white)
|
||||
.padding(.vertical, 16)
|
||||
|
||||
@@ -67,13 +67,13 @@ final class SignUpViewModel: ObservableObject {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
}
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
@@ -83,25 +83,25 @@ final class SignUpViewModel: ObservableObject {
|
||||
|
||||
private func validate() -> Bool {
|
||||
if email.trimmingCharacters(in: .whitespaces).isEmpty || !validateEmail() {
|
||||
errorMessage = "올바른 이메일을 입력하세요"
|
||||
errorMessage = I18n.User.emailInvalid
|
||||
isShowPopup = true
|
||||
return false
|
||||
}
|
||||
|
||||
if password.trimmingCharacters(in: .whitespaces).isEmpty {
|
||||
errorMessage = "비밀번호를 입력하세요"
|
||||
errorMessage = I18n.User.passwordRequired
|
||||
isShowPopup = true
|
||||
return false
|
||||
}
|
||||
|
||||
if !validatePassword() {
|
||||
errorMessage = "영문, 숫자 포함 8자 이상의 비밀번호를 입력해 주세요."
|
||||
errorMessage = I18n.ProfileUpdate.passwordRuleHint
|
||||
isShowPopup = true
|
||||
return false
|
||||
}
|
||||
|
||||
if !isAgreeTerms || !isAgreePrivacyPolicy {
|
||||
errorMessage = "약관에 동의하셔야 회원가입이 가능합니다."
|
||||
errorMessage = I18n.SignUp.agreementRequired
|
||||
isShowPopup = true
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ struct UserTextField: View {
|
||||
Image("btn_select_normal")
|
||||
}
|
||||
|
||||
Text("비밀번호 표시")
|
||||
Text(I18n.User.showPassword)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
}
|
||||
@@ -74,8 +74,8 @@ struct UserTextField: View {
|
||||
struct UserTextField_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
UserTextField(
|
||||
title: "이메일",
|
||||
hint: "user_id@email.com",
|
||||
title: I18n.User.passwordTitle,
|
||||
hint: I18n.User.passwordPlaceholder,
|
||||
isSecure: true,
|
||||
variable: .constant("test"),
|
||||
isPasswordVisibleButton: true
|
||||
|
||||
@@ -54,13 +54,13 @@ final class UserViewModel: ObservableObject {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
}
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
self.isShowPopup = true
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ final class UserViewModel: ObservableObject {
|
||||
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
|
||||
|
||||
if decoded.success {
|
||||
self.errorMessage = "차단하였습니다."
|
||||
self.errorMessage = I18n.MemberChannel.userBlocked
|
||||
self.dismissDialog = true
|
||||
|
||||
self.memberId = 0
|
||||
@@ -97,13 +97,13 @@ final class UserViewModel: ObservableObject {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
}
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ final class UserViewModel: ObservableObject {
|
||||
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
|
||||
|
||||
if decoded.success {
|
||||
self.errorMessage = "차단이 해제 되었습니다."
|
||||
self.errorMessage = I18n.MemberChannel.userUnblocked
|
||||
self.dismissDialog = true
|
||||
|
||||
self.memberId = 0
|
||||
@@ -138,20 +138,20 @@ final class UserViewModel: ObservableObject {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
}
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
.store(in: &subscription)
|
||||
}
|
||||
|
||||
func report(type: ReportType, reason: String = "프로필 신고") {
|
||||
func report(type: ReportType, reason: String = I18n.Report.profileReportReason) {
|
||||
isLoading = true
|
||||
|
||||
let request = ReportRequest(type: type, reason: reason, reportedMemberId: memberId, cheersId: nil, audioContentId: nil)
|
||||
@@ -178,12 +178,12 @@ final class UserViewModel: ObservableObject {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user