feat(i18n): 마이페이지 하드코딩 문구를 I18n 키로 통일한다

This commit is contained in:
Yu Sung
2026-03-31 23:04:33 +09:00
parent 25fccbaa07
commit b53614836f
21 changed files with 483 additions and 176 deletions

View File

@@ -25,7 +25,7 @@ struct CanChargeView: View {
var body: some View {
BaseView(isLoading: $storeManager.isLoading) {
VStack(spacing: 13.3) {
DetailNavigationBar(title: "충전하기")
DetailNavigationBar(title: I18n.MyPage.Can.chargeTitle)
if UserDefaults.bool(forKey: .auth) {
CanChargeTabView(currentTab: $currentTab)
@@ -121,16 +121,7 @@ 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 = "can"
default:
unit = "cans"
}
return text.replacingOccurrences(of: "", with: unit)
text.replacingOccurrences(of: I18n.MyPage.Can.koreanUnitToken, with: I18n.MyPage.Can.localizedUnit)
}
struct CanChargeTabView: View {

View File

@@ -43,13 +43,13 @@ final class CanChargeViewModel: 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
}
}