프로필 수정 화면 문자열 다국어 적용
마이페이지 프로필 수정에서 소셜 링크와 비밀번호 안내 문구를\n다국어로 제공한다.
This commit is contained in:
@@ -171,29 +171,29 @@ struct ProfileUpdateView: View {
|
||||
func InstagramAndYoutubeAccountView() -> some View {
|
||||
VStack(spacing: 16.7) {
|
||||
UserTextField(
|
||||
title: "인스타그램",
|
||||
hint: "인스타그램 URL",
|
||||
title: I18n.ProfileUpdate.instagram,
|
||||
hint: I18n.ProfileUpdate.instagramUrlPlaceholder,
|
||||
isSecure: false,
|
||||
variable: $viewModel.instagramUrl
|
||||
)
|
||||
|
||||
UserTextField(
|
||||
title: "유튜브",
|
||||
hint: "유튜브 URL",
|
||||
title: I18n.ProfileUpdate.youtube,
|
||||
hint: I18n.ProfileUpdate.youtubeUrlPlaceholder,
|
||||
isSecure: false,
|
||||
variable: $viewModel.youtubeUrl
|
||||
)
|
||||
|
||||
UserTextField(
|
||||
title: "웹사이트",
|
||||
hint: "웹사이트 URL",
|
||||
title: I18n.ProfileUpdate.website,
|
||||
hint: I18n.ProfileUpdate.websiteUrlPlaceholder,
|
||||
isSecure: false,
|
||||
variable: $viewModel.websiteUrl
|
||||
)
|
||||
|
||||
UserTextField(
|
||||
title: "블로그",
|
||||
hint: "블로그 URL",
|
||||
title: I18n.ProfileUpdate.blog,
|
||||
hint: I18n.ProfileUpdate.blogUrlPlaceholder,
|
||||
isSecure: false,
|
||||
variable: $viewModel.blogUrl
|
||||
)
|
||||
|
||||
@@ -48,7 +48,7 @@ final class ProfileUpdateViewModel: ObservableObject {
|
||||
|
||||
var refresh: () -> Void = {}
|
||||
|
||||
let placeholder = "소개글을 입력하세요"
|
||||
let placeholder = I18n.ProfileUpdate.introductionPlaceholder
|
||||
|
||||
func getMyProfile() {
|
||||
isLoading = true
|
||||
@@ -86,13 +86,13 @@ final class ProfileUpdateViewModel: 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
|
||||
}
|
||||
}
|
||||
@@ -142,7 +142,7 @@ final class ProfileUpdateViewModel: ObservableObject {
|
||||
|
||||
if let _ = decoded.data, decoded.success {
|
||||
self.refresh()
|
||||
self.errorMessage = "프로필이 변경되었습니다."
|
||||
self.errorMessage = I18n.ProfileUpdate.profileUpdated
|
||||
self.isShowPopup = true
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
@@ -152,13 +152,13 @@ final class ProfileUpdateViewModel: 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
|
||||
}
|
||||
}
|
||||
@@ -171,25 +171,25 @@ final class ProfileUpdateViewModel: ObservableObject {
|
||||
|
||||
func updatePassword() {
|
||||
if currentPassword.trimmingCharacters(in: .whitespaces).isEmpty {
|
||||
errorMessage = "현재 비밀번호를 입력하세요."
|
||||
errorMessage = I18n.ProfileUpdate.passwordCurrentRequired
|
||||
isShowPopup = true
|
||||
return
|
||||
}
|
||||
|
||||
if newPassword.trimmingCharacters(in: .whitespaces).isEmpty {
|
||||
errorMessage = "변경할 비밀번호를 입력하세요."
|
||||
errorMessage = I18n.ProfileUpdate.passwordNewRequired
|
||||
isShowPopup = true
|
||||
return
|
||||
}
|
||||
|
||||
if newPassword != newPasswordConfirm {
|
||||
errorMessage = "비밀번호가 일치하지 않습니다."
|
||||
errorMessage = I18n.ProfileUpdate.passwordNotMatch
|
||||
isShowPopup = true
|
||||
return
|
||||
}
|
||||
|
||||
if !validatePassword() {
|
||||
errorMessage = "영문, 숫자 포함 8자 이상의 비밀번호를 입력해 주세요."
|
||||
errorMessage = I18n.ProfileUpdate.passwordRuleHint
|
||||
isShowPopup = true
|
||||
return
|
||||
}
|
||||
@@ -218,7 +218,7 @@ final class ProfileUpdateViewModel: ObservableObject {
|
||||
let decoded = try jsonDecoder.decode(ApiResponse<GetProfileResponse>.self, from: responseData)
|
||||
|
||||
if let _ = decoded.data, decoded.success {
|
||||
self.errorMessage = "비밀번호가 변경되었습니다."
|
||||
self.errorMessage = I18n.ProfileUpdate.passwordUpdated
|
||||
self.isShowPopup = true
|
||||
self.currentPassword = ""
|
||||
self.newPassword = ""
|
||||
@@ -231,13 +231,13 @@ final class ProfileUpdateViewModel: 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
|
||||
}
|
||||
}
|
||||
@@ -303,19 +303,19 @@ final class ProfileUpdateViewModel: 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)
|
||||
} else {
|
||||
self.errorMessage = "프로필 이미지를 업데이트 하지 못했습니다.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.ProfileUpdate.profileImageUpdateFailed
|
||||
self.isShowPopup = true
|
||||
self.isLoading = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user