feat(i18n): 탐색 프로필 하드코딩 문구를 I18n 키로 통일한다
This commit is contained in:
@@ -24,12 +24,12 @@ struct CreatorCommunityModifyView: View {
|
||||
GeometryReader { proxy in
|
||||
ZStack {
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: "게시글 수정")
|
||||
DetailNavigationBar(title: I18n.Explorer.postModifyTitle)
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
VStack(spacing: 0) {
|
||||
VStack(spacing: 13.3) {
|
||||
Text("이미지")
|
||||
Text(I18n.Explorer.imageTitle)
|
||||
.appFont(size: 16.7, weight: .bold)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
@@ -81,7 +81,7 @@ struct CreatorCommunityModifyView: View {
|
||||
viewModel.postImageData = data
|
||||
}
|
||||
} catch {
|
||||
viewModel.errorMessage = "이미지를 로드하지 못했습니다."
|
||||
viewModel.errorMessage = I18n.Explorer.imageLoadFailed
|
||||
viewModel.isShowPopup = true
|
||||
DEBUG_LOG("이미지 로드 실패: \(error)")
|
||||
}
|
||||
@@ -94,24 +94,24 @@ struct CreatorCommunityModifyView: View {
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color(hex: "777777"))
|
||||
|
||||
Text("등록할 이미지가 없으면 이미지 없이 게시글만 등록 하셔도 됩니다.")
|
||||
Text(I18n.Explorer.imageOptionalNotice)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color(hex: "777777"))
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(.top, 24)
|
||||
|
||||
|
||||
HStack(spacing: 0) {
|
||||
Text("내용")
|
||||
Text(I18n.Explorer.contentTitle)
|
||||
.appFont(size: 16.7, weight: .bold)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("\(viewModel.content.count)자")
|
||||
Text("\(viewModel.content.count)\(I18n.Explorer.contentCharacterUnit)")
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color(hex: "ff5c49"))
|
||||
Text(" / 최대 500자")
|
||||
Text(I18n.Explorer.max500Chars)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color(hex: "777777"))
|
||||
}
|
||||
@@ -128,14 +128,14 @@ struct CreatorCommunityModifyView: View {
|
||||
.padding(.top, 13.3)
|
||||
|
||||
VStack(spacing: 13.3) {
|
||||
Text("댓글 가능 여부")
|
||||
Text(I18n.Explorer.commentAvailability)
|
||||
.appFont(size: 16.7, weight: .bold)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
HStack(spacing: 13.3) {
|
||||
SelectButtonView(
|
||||
title: "댓글 가능",
|
||||
title: I18n.CreateContent.commentAllowed,
|
||||
isChecked: viewModel.isAvailableComment
|
||||
) {
|
||||
if !viewModel.isAvailableComment {
|
||||
@@ -144,7 +144,7 @@ struct CreatorCommunityModifyView: View {
|
||||
}
|
||||
|
||||
SelectButtonView(
|
||||
title: "댓글 불가",
|
||||
title: I18n.CreateContent.commentNotAllowed,
|
||||
isChecked: !viewModel.isAvailableComment
|
||||
) {
|
||||
if viewModel.isAvailableComment {
|
||||
@@ -156,14 +156,14 @@ struct CreatorCommunityModifyView: View {
|
||||
.padding(.top, 26.7)
|
||||
|
||||
VStack(spacing: 13.3) {
|
||||
Text("연령 제한")
|
||||
Text(I18n.Explorer.ageRestriction)
|
||||
.appFont(size: 16.7, weight: .bold)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
HStack(spacing: 13.3) {
|
||||
SelectButtonView(
|
||||
title: "전체 연령",
|
||||
title: I18n.CreateContent.allAges,
|
||||
isChecked: !viewModel.isAdult
|
||||
) {
|
||||
if viewModel.isAdult {
|
||||
@@ -172,7 +172,7 @@ struct CreatorCommunityModifyView: View {
|
||||
}
|
||||
|
||||
SelectButtonView(
|
||||
title: "19세 이상",
|
||||
title: I18n.CreateContent.over19,
|
||||
isChecked: viewModel.isAdult
|
||||
) {
|
||||
if !viewModel.isAdult {
|
||||
@@ -187,7 +187,7 @@ struct CreatorCommunityModifyView: View {
|
||||
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 13.3) {
|
||||
Text("닫기")
|
||||
Text(I18n.Explorer.close)
|
||||
.appFont(size: 18.3, weight: .bold)
|
||||
.foregroundColor(Color(hex: "3BB9F1"))
|
||||
.frame(maxWidth: .infinity)
|
||||
@@ -203,7 +203,7 @@ struct CreatorCommunityModifyView: View {
|
||||
AppState.shared.back()
|
||||
}
|
||||
|
||||
Text("수정")
|
||||
Text(I18n.Explorer.modify)
|
||||
.appFont(size: 18.3, weight: .bold)
|
||||
.foregroundColor(Color.white)
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
@@ -24,7 +24,7 @@ final class CreatorCommunityModifyViewModel: ObservableObject {
|
||||
@Published var postImageUrl: String? = nil
|
||||
@Published private(set) var communityPost: GetCommunityPostListResponse?
|
||||
|
||||
var placeholder = "내용을 입력하세요"
|
||||
var placeholder = I18n.Explorer.inputContent
|
||||
var postId = 0
|
||||
|
||||
func getCommunityPostDetail(onFailure: (() -> Void)? = nil) {
|
||||
@@ -58,7 +58,7 @@ final class CreatorCommunityModifyViewModel: ObservableObject {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
@@ -67,7 +67,7 @@ final class CreatorCommunityModifyViewModel: ObservableObject {
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.Common.commonError
|
||||
self.isShowPopup = true
|
||||
if let onFailure = onFailure {
|
||||
onFailure()
|
||||
@@ -126,7 +126,7 @@ final class CreatorCommunityModifyViewModel: ObservableObject {
|
||||
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
|
||||
|
||||
if decoded.success {
|
||||
self.errorMessage = "게시물이 수정되었습니다."
|
||||
self.errorMessage = I18n.Explorer.postUpdated
|
||||
self.isShowPopup = true
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
@@ -136,19 +136,19 @@ final class CreatorCommunityModifyViewModel: 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.Common.commonError
|
||||
self.isShowPopup = true
|
||||
self.isLoading = false
|
||||
}
|
||||
@@ -157,7 +157,7 @@ final class CreatorCommunityModifyViewModel: ObservableObject {
|
||||
|
||||
private func validateData() -> Bool {
|
||||
if content.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || content.count < 5 {
|
||||
errorMessage = "내용을 5자 이상 입력해 주세요."
|
||||
errorMessage = I18n.Explorer.minContentLength(5)
|
||||
isShowPopup = true
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user