시리즈 상세 화면 현지화 문자열 제공

시리즈 상세 화면의 탭과 섹션 제목을 다국어로 제공한다.
가격 표시와 요일 표기를 로케일에 맞게 보여준다.
This commit is contained in:
Yu Sung
2025-12-19 18:30:52 +09:00
parent e035e57fc2
commit 27b024f187
4 changed files with 165 additions and 108 deletions

View File

@@ -15,7 +15,7 @@ struct SeriesDetailIntroductionView: View {
var body: some View {
VStack(alignment: .leading, spacing: 16) {
Text("키워드")
Text(I18n.SeriesDetail.keywords)
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
.padding(.top, 16)
@@ -31,7 +31,7 @@ struct SeriesDetailIntroductionView: View {
.foregroundColor(Color.gray22)
VStack(alignment: .leading, spacing: 13.3) {
Text("작품소개")
Text(I18n.SeriesDetail.workIntro)
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
@@ -47,37 +47,37 @@ struct SeriesDetailIntroductionView: View {
.foregroundColor(Color.gray22)
VStack(alignment: .leading, spacing: 16) {
Text("상세정보")
Text(I18n.SeriesDetail.details)
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
HStack(spacing: 30) {
VStack(alignment: .leading, spacing: 13.3) {
Text("장르")
Text(I18n.SeriesDetail.genre)
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
Text("연령제한")
Text(I18n.SeriesDetail.ageLimit)
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
if let _ = seriesDetail.writer {
Text("작가")
Text(I18n.SeriesDetail.writer)
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
}
if let _ = seriesDetail.studio {
Text("제작사")
Text(I18n.SeriesDetail.studio)
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
}
Text("연재")
Text(I18n.SeriesDetail.schedule)
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
Text("출시일")
Text(I18n.SeriesDetail.releaseDate)
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
}
@@ -87,7 +87,7 @@ struct SeriesDetailIntroductionView: View {
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.white)
Text(seriesDetail.isAdult ? "19세 이상" : "전체연령가")
Text(seriesDetail.isAdult ? I18n.SeriesDetail.age19Plus : I18n.SeriesDetail.ageAll)
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.white)
@@ -103,7 +103,7 @@ struct SeriesDetailIntroductionView: View {
.foregroundColor(Color.white)
}
Text(seriesDetail.publishedDaysOfWeek == "랜덤" ? seriesDetail.publishedDaysOfWeek : "\(seriesDetail.publishedDaysOfWeek)")
Text(seriesDetail.publishedDaysOfWeek == "랜덤" ? I18n.SeriesDetail.random : "\(seriesDetail.publishedDaysOfWeek)")
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.white)
@@ -116,23 +116,23 @@ struct SeriesDetailIntroductionView: View {
.padding(.horizontal, 13.3)
VStack(alignment: .leading, spacing: 13.3) {
Text("가격")
Text(I18n.SeriesDetail.price)
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
HStack(spacing: 30) {
VStack(alignment: .leading, spacing: 13.3) {
Text("대여")
Text(I18n.SeriesDetail.rentLabel)
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
Text("소장")
Text(I18n.SeriesDetail.buyLabel)
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
}
VStack(alignment: .leading, spacing: 13.3) {
Text("\(calculatePriceInfo(seriesDetail.rentalMinPrice, seriesDetail.rentalMaxPrice)) (5일)")
Text("\(calculatePriceInfo(seriesDetail.rentalMinPrice, seriesDetail.rentalMaxPrice)) \(I18n.SeriesDetail.daysSuffix(5))")
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.button)
@@ -147,14 +147,6 @@ struct SeriesDetailIntroductionView: View {
}
func calculatePriceInfo(_ minPrice: Int, _ maxPrice: Int) -> String {
if minPrice == maxPrice {
if maxPrice == 0 {
return "무료"
} else {
return "\(maxPrice)"
}
} else {
return "\(minPrice == 0 ? "무료" : "\(minPrice)") ~ \(maxPrice)"
}
I18n.SeriesDetail.priceInfo(min: minPrice, max: maxPrice)
}
}

View File

@@ -174,7 +174,7 @@ struct SeriesDetailView: View {
HStack(spacing: 0) {
SeriesDetailTabView(
title: "",
title: I18n.SeriesDetail.home,
width: screenSize().width / 2,
isSelected: viewModel.currentTab == .home
) {
@@ -182,9 +182,9 @@ struct SeriesDetailView: View {
viewModel.currentTab = .home
}
}
SeriesDetailTabView(
title: "작품소개",
title: I18n.SeriesDetail.introduction,
width: screenSize().width / 2,
isSelected: viewModel.currentTab == .introduction
) {