프로필 수정 화면 문자열 다국어 적용

마이페이지 프로필 수정에서 소셜 링크와 비밀번호 안내 문구를\n다국어로 제공한다.
This commit is contained in:
Yu Sung
2025-12-19 19:59:27 +09:00
parent f67fd5bb26
commit 0ddb5810b1
3 changed files with 81 additions and 24 deletions

View File

@@ -467,6 +467,63 @@ enum I18n {
static var buy: String { pick(ko: "소장하기", en: "Buy", ja: "購入する") }
static var purchase: String { pick(ko: "구매하기", en: "Purchase", ja: "購入する") }
}
// >
enum ProfileUpdate {
//
static var instagram: String { pick(ko: "인스타그램", en: "Instagram", ja: "インスタグラム") }
static var youtube: String { pick(ko: "유튜브", en: "YouTube", ja: "YouTube") }
static var website: String { pick(ko: "웹사이트", en: "Website", ja: "ウェブサイト") }
static var blog: String { pick(ko: "블로그", en: "Blog", ja: "ブログ") }
//
static var instagramUrlPlaceholder: String {
pick(ko: "인스타그램 URL", en: "Instagram URL", ja: "インスタグラムURL")
}
static var youtubeUrlPlaceholder: String {
pick(ko: "유튜브 URL", en: "YouTube URL", ja: "YouTubeのURL")
}
static var websiteUrlPlaceholder: String {
pick(ko: "웹사이트 URL", en: "Website URL", ja: "ウェブサイトのURL")
}
static var blogUrlPlaceholder: String {
pick(ko: "블로그 URL", en: "Blog URL", ja: "ブログのURL")
}
//
static var introductionPlaceholder: String {
pick(ko: "소개글을 입력하세요", en: "Enter your introduction", ja: "自己紹介を入力してください")
}
// / /
static var profileUpdated: String {
pick(ko: "프로필이 변경되었습니다.", en: "Profile has been updated.", ja: "プロフィールが更新されました。")
}
static var passwordCurrentRequired: String {
pick(ko: "현재 비밀번호를 입력하세요.", en: "Please enter your current password.", ja: "現在のパスワードを入力してください。")
}
static var passwordNewRequired: String {
pick(ko: "변경할 비밀번호를 입력하세요.", en: "Please enter a new password.", ja: "新しいパスワードを入力してください。")
}
static var passwordNotMatch: String {
pick(ko: "비밀번호가 일치하지 않습니다.", en: "Passwords do not match.", ja: "パスワードが一致しません。")
}
static var passwordRuleHint: String {
pick(ko: "영문, 숫자 포함 8자 이상의 비밀번호를 입력해 주세요.", en: "Enter a password of at least 8 characters with letters and numbers.", ja: "英字と数字を含む8文字以上のパスワードを入力してください。")
}
static var passwordUpdated: String {
pick(ko: "비밀번호가 변경되었습니다.", en: "Password has been changed.", ja: "パスワードが変更されました。")
}
static var profileImageUpdateFailed: String {
pick(
ko: "프로필 이미지를 업데이트 하지 못했습니다.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다.",
en: "Could not update the profile image.\nIf the problem persists, please contact customer support.",
ja: "プロフィール画像を更新できませんでした。\n問題が続く場合はカスタマーサポートにお問い合わせください。"
)
}
}
}
// MARK: -

View File

@@ -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
)

View File

@@ -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
}