feat(i18n): 라이브 룸 하드코딩 문구를 I18n 키로 통일한다
This commit is contained in:
@@ -27,7 +27,7 @@ struct LiveRoomEditView: View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
ZStack {
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: "라이브 수정")
|
||||
DetailNavigationBar(title: I18n.CreateLive.editLiveTitle)
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
VStack(spacing: 0) {
|
||||
@@ -53,7 +53,7 @@ struct LiveRoomEditView: View {
|
||||
}
|
||||
|
||||
if !viewModel.isLoading {
|
||||
Text("라이브 수정")
|
||||
Text(I18n.CreateLive.editLiveTitle)
|
||||
.appFont(size: 18.3, weight: .bold)
|
||||
.foregroundColor(Color.white)
|
||||
.frame(width: screenSize().width - 26.7, height: 50)
|
||||
@@ -94,13 +94,13 @@ struct LiveRoomEditView: View {
|
||||
@ViewBuilder
|
||||
func TitleInputView() -> some View {
|
||||
VStack(spacing: 0) {
|
||||
Text("제목")
|
||||
Text(I18n.CreateLive.titleLabel)
|
||||
.appFont(size: 16.7, weight: .bold)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.padding(.horizontal, 13.3)
|
||||
.frame(width: screenSize().width, alignment: .leading)
|
||||
|
||||
TextField("라이브 제목을 입력하세요", text: $viewModel.title)
|
||||
TextField(I18n.CreateLive.titlePlaceholder, text: $viewModel.title)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
@@ -121,16 +121,16 @@ struct LiveRoomEditView: View {
|
||||
func ContentInputView() -> some View {
|
||||
VStack(spacing: 13.3) {
|
||||
HStack(spacing: 0) {
|
||||
Text("공지")
|
||||
Text(I18n.CreateLive.noticeLabel)
|
||||
.appFont(size: 16.7, weight: .bold)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("\(viewModel.notice.count)자")
|
||||
Text(I18n.CreateLive.noticeCount(viewModel.notice.count))
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color(hex: "ff5c49"))
|
||||
Text(" / 1000자")
|
||||
Text(I18n.CreateLive.noticeLimitSuffix)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color(hex: "777777"))
|
||||
}
|
||||
@@ -151,7 +151,7 @@ struct LiveRoomEditView: View {
|
||||
func ReservationDateTimeView(buttonWidth: CGFloat) -> some View {
|
||||
HStack(spacing: 13.3) {
|
||||
VStack(alignment: .leading, spacing: 6.7) {
|
||||
Text("예약 날짜")
|
||||
Text(I18n.CreateLive.reservationDateLabel)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
|
||||
@@ -171,7 +171,7 @@ struct LiveRoomEditView: View {
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 6.7) {
|
||||
Text("예약 시간")
|
||||
Text(I18n.CreateLive.reservationTimeLabel)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
|
||||
@@ -198,12 +198,12 @@ struct LiveRoomEditView: View {
|
||||
@ViewBuilder
|
||||
func NumberOfPeopleLimitView() -> some View {
|
||||
VStack(spacing: 13.3) {
|
||||
Text("참여인원 설정")
|
||||
Text(I18n.CreateLive.participantLimitLabel)
|
||||
.appFont(size: 16.7, weight: .bold)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.frame(width: screenSize().width - 26.7, alignment: .leading)
|
||||
|
||||
TextField("최대 인원 999명", text: $viewModel.numberOfPeople)
|
||||
TextField(I18n.CreateLive.participantLimitPlaceholder, text: $viewModel.numberOfPeople)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.multilineTextAlignment(.center)
|
||||
@@ -285,7 +285,7 @@ struct LiveRoomEditView: View {
|
||||
.frame(width: proxy.size.width)
|
||||
|
||||
Button(action: { self.isShowSelectDateView = false }) {
|
||||
Text("확인")
|
||||
Text(I18n.CreateLive.confirmButton)
|
||||
.appFont(size: 16)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.padding(.vertical, 10)
|
||||
@@ -316,7 +316,7 @@ struct LiveRoomEditView: View {
|
||||
.frame(width: proxy.size.width - 53.4)
|
||||
|
||||
Button(action: { self.isShowSelectTimeView = false }) {
|
||||
Text("확인")
|
||||
Text(I18n.CreateLive.confirmButton)
|
||||
.appFont(size: 16)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.padding(.vertical, 10)
|
||||
|
||||
@@ -51,7 +51,7 @@ final class LiveRoomEditViewModel: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
let placeholder = "라이브 공지를 입력하세요"
|
||||
let placeholder = I18n.CreateLive.noticePlaceholder
|
||||
|
||||
var room: GetRoomDetailResponse? = nil {
|
||||
didSet {
|
||||
@@ -103,7 +103,7 @@ final class LiveRoomEditViewModel: ObservableObject {
|
||||
request.beginDateTimeString == nil &&
|
||||
request.genderRestriction == nil
|
||||
) {
|
||||
self.errorMessage = "변경사항이 없습니다."
|
||||
self.errorMessage = I18n.CreateLive.noChangesMessage
|
||||
self.isShowPopup = true
|
||||
isLoading = false
|
||||
return
|
||||
@@ -135,7 +135,7 @@ final class LiveRoomEditViewModel: ObservableObject {
|
||||
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
|
||||
|
||||
if decoded.success {
|
||||
self.errorMessage = "라이브 정보가 수정되었습니다."
|
||||
self.errorMessage = I18n.CreateLive.editSuccessMessage
|
||||
self.isShowPopup = true
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
@@ -146,19 +146,19 @@ final class LiveRoomEditViewModel: ObservableObject {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "라이브 정보를 수정 하지 못했습니다.\n다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.CreateLive.editFailedMessage
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
}
|
||||
} catch {
|
||||
self.errorMessage = "라이브 정보를 수정 하지 못했습니다.\n다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.CreateLive.editFailedMessage
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
.store(in: &subscription)
|
||||
} else {
|
||||
self.errorMessage = "라이브 정보를 수정 하지 못했습니다.\n다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.errorMessage = I18n.CreateLive.editFailedMessage
|
||||
self.isShowPopup = true
|
||||
self.isLoading = false
|
||||
}
|
||||
@@ -167,20 +167,20 @@ final class LiveRoomEditViewModel: ObservableObject {
|
||||
|
||||
private func validate() -> Bool {
|
||||
if title.trimmingCharacters(in: .whitespaces).isEmpty {
|
||||
self.errorMessage = "제목을 입력해 주세요."
|
||||
self.errorMessage = I18n.CreateLive.enterTitle
|
||||
self.isShowPopup = true
|
||||
return false
|
||||
}
|
||||
|
||||
let notice = notice.trimmingCharacters(in: .whitespacesAndNewlines) != placeholder ? notice : ""
|
||||
if notice.isEmpty && notice.count < 5 {
|
||||
self.errorMessage = "공지를 5자 이상 입력해주세요."
|
||||
self.errorMessage = I18n.CreateLive.enterNoticeMin5
|
||||
self.isShowPopup = true
|
||||
return false
|
||||
}
|
||||
|
||||
guard let numberOfPeople = Int(numberOfPeople), (numberOfPeople >= 3 && numberOfPeople <= 999) else {
|
||||
self.errorMessage = "인원을 3~999명 사이로 입력해주세요."
|
||||
self.errorMessage = I18n.CreateLive.enterPeopleRange
|
||||
self.isShowPopup = true
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user