feat(home): AI 캐릭터 섹션을 연결한다

This commit is contained in:
Yu Sung
2026-06-29 18:56:35 +09:00
parent 638aa26789
commit 561e991050
7 changed files with 256 additions and 39 deletions

View File

@@ -3090,7 +3090,58 @@ If you block this user, the following features will be restricted.
}
static var aiCharacterSectionTitle: String {
pick(ko: "AI 캐릭터", en: "AI characters", ja: "AIキャラクター")
pick(ko: "크리에이터와 이야기를 나눠요!", en: "AI characters", ja: "AIキャラクター")
}
static func compactChatCount(_ count: Int) -> String {
pick(
ko: compactEastAsianCount(count, tenMillionUnit: "", tenThousandUnit: "", thousandUnit: ""),
en: compactEnglishCount(count),
ja: compactEastAsianCount(count, tenMillionUnit: "", tenThousandUnit: "", thousandUnit: "")
)
}
private static func compactEastAsianCount(
_ count: Int,
tenMillionUnit: String,
tenThousandUnit: String,
thousandUnit: String
) -> String {
if count >= 100_000_000 {
return compactCountValue(count, divisor: 100_000_000, unit: tenMillionUnit)
}
if count >= 10_000 {
return compactCountValue(count, divisor: 10_000, unit: tenThousandUnit)
}
if count >= 1_000 {
return compactCountValue(count, divisor: 1_000, unit: thousandUnit)
}
return count.comma()
}
private static func compactEnglishCount(_ count: Int) -> String {
if count >= 1_000_000_000 {
return compactCountValue(count, divisor: 1_000_000_000, unit: "B")
}
if count >= 1_000_000 {
return compactCountValue(count, divisor: 1_000_000, unit: "M")
}
if count >= 1_000 {
return compactCountValue(count, divisor: 1_000, unit: "K")
}
return count.comma()
}
private static func compactCountValue(_ count: Int, divisor: Int, unit: String) -> String {
let value = floor((Double(count) / Double(divisor)) * 10) / 10
let format = value.truncatingRemainder(dividingBy: 1) == 0 ? "%.0f" : "%.1f"
return String(format: format, locale: Locale(identifier: "en_US_POSIX"), value) + unit
}
static var genreCreatorSectionTitle: String {