feat(i18n): 마이페이지 하드코딩 문구를 I18n 키로 통일한다
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user