From 7c1d57676c693738d03c3cc48c99d364f6df5b7c Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Sat, 20 Dec 2025 00:15:57 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BA=94=20=EB=8B=A8=EC=9C=84=20=ED=91=9C?= =?UTF-8?q?=EA=B8=B0=20=ED=98=84=EC=A7=80=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 캔 관련 텍스트가 앱 언어에 맞게 변환된다. --- .../MyPage/Can/Charge/CanChargeView.swift | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/SodaLive/Sources/MyPage/Can/Charge/CanChargeView.swift b/SodaLive/Sources/MyPage/Can/Charge/CanChargeView.swift index 41a5b2e..515e9d7 100644 --- a/SodaLive/Sources/MyPage/Can/Charge/CanChargeView.swift +++ b/SodaLive/Sources/MyPage/Can/Charge/CanChargeView.swift @@ -94,7 +94,7 @@ struct CanItemView: View { var body: some View { HStack(spacing: 0) { - Text(item.localizedTitle) + Text(localizeCanWord(in: item.localizedTitle)) .font(.custom(Font.bold.rawValue, size: 15.3)) .foregroundColor(Color(hex: "eeeeee")) @@ -118,7 +118,7 @@ struct CanPgItemView: View { var body: some View { HStack(spacing: 0) { - Text(item.title) + Text(localizeCanWord(in: item.title)) .font(.custom(Font.bold.rawValue, size: 15.3)) .foregroundColor(Color(hex: "eeeeee")) @@ -137,6 +137,20 @@ struct CanPgItemView: View { } } +// MARK: - Localize "캔" unit inside arbitrary text based on current app language +fileprivate func localizeCanWord(in text: String) -> String { + let unit: String + switch LanguageHeaderProvider.current { + case "ko": + unit = "캔" + case "ja": + unit = "缶" + default: + unit = "cans" + } + return text.replacingOccurrences(of: "캔", with: unit) +} + struct CanChargeTabView: View { @Binding var currentTab: CanChargeCurrentTab