Skip to content

Commit 17b9619

Browse files
committed
feat: 화면 문자열 하드코딩 제거 및 로컬라이제이션 적용
1 parent 6655483 commit 17b9619

37 files changed

Lines changed: 333 additions & 234 deletions

DevLog/Presentation/Structure/Profile/ProfileActivityType.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ enum ProfileActivityType: String, CaseIterable, Hashable {
1313

1414
var title: String {
1515
switch self {
16-
case .created: return "생성"
17-
case .completed: return "완료"
16+
case .created: return String(localized: "profile_activity_created")
17+
case .completed: return String(localized: "profile_activity_completed")
1818
}
1919
}
2020
}

DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ struct ProfileSelectedDayActivity: Identifiable, Hashable {
1616

1717
var activityLabel: String {
1818
if showsCreated && showsCompleted {
19-
return "생성/완료"
19+
return String(localized: "profile_activity_created_completed")
2020
}
21-
return showsCreated ? "생성" : "완료"
21+
return showsCreated
22+
? String(localized: "profile_activity_created")
23+
: String(localized: "profile_activity_completed")
2224
}
2325
}

DevLog/Presentation/Structure/WebPageItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct WebPageItem: Identifiable, Hashable {
1515
}
1616

1717
var id: URL { metadata.url }
18-
var title: String { metadata.title ?? "웹페이지를 찾을 수 없습니다" }
18+
var title: String { metadata.title ?? String(localized: "web_page_missing_title") }
1919
var url: URL { metadata.url }
2020
var displayURL: String { metadata.displayURL.absoluteString }
2121
var imageURL: URL? { metadata.imageURL }

DevLog/Presentation/ViewModel/AccountViewModel.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,17 @@ private extension AccountViewModel {
160160
func setAlert(_ state: inout State, isPresented: Bool, type: AlertType?) {
161161
switch type {
162162
case .linkEmailNotFound:
163-
state.alertTitle = "이메일 확인 불가"
164-
state.alertMessage = "선택한 계정의 이메일 정보를 확인할 수 없어 연결할 수 없어요. 계정 설정을 확인한 뒤 다시 시도해주세요."
163+
state.alertTitle = String(localized: "account_alert_email_unavailable_title")
164+
state.alertMessage = String(localized: "account_alert_email_unavailable_message")
165165
case .linkEmailMismatch:
166-
state.alertTitle = "연결할 수 없음"
167-
state.alertMessage = "현재 로그인한 계정과 선택한 계정의 이메일이 달라 연결할 수 없어요. 같은 이메일의 계정으로 다시 시도해주세요."
166+
state.alertTitle = String(localized: "account_alert_cannot_link_title")
167+
state.alertMessage = String(localized: "account_alert_cannot_link_message")
168168
case .linkCredentialAlreadyInUse:
169-
state.alertTitle = "이미 연결된 계정"
170-
state.alertMessage = "선택한 계정은 이미 다른 계정에 연결되어 있어요. 해당 계정으로 로그인한 뒤 이용해주세요."
169+
state.alertTitle = String(localized: "account_alert_already_linked_title")
170+
state.alertMessage = String(localized: "account_alert_already_linked_message")
171171
case .error:
172-
state.alertTitle = "오류"
173-
state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요."
172+
state.alertTitle = String(localized: "common_error_title")
173+
state.alertMessage = String(localized: "common_error_message")
174174
case .none:
175175
state.alertTitle = ""
176176
state.alertMessage = ""
@@ -182,9 +182,9 @@ private extension AccountViewModel {
182182
func setToast(_ state: inout State, isPresented: Bool, type: ToastType?) {
183183
switch type {
184184
case .linkSuccess:
185-
state.toastMessage = "계정이 성공적으로 연결되었습니다."
185+
state.toastMessage = String(localized: "account_toast_link_success")
186186
case .unlinkSuccess:
187-
state.toastMessage = "계정 연결이 성공적으로 해제되었습니다."
187+
state.toastMessage = String(localized: "account_toast_unlink_success")
188188
case .none:
189189
state.toastMessage = ""
190190
}

DevLog/Presentation/ViewModel/HomeViewModel.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,15 @@ private extension HomeViewModel {
390390
) {
391391
switch type {
392392
case .webPageInput:
393-
state.alertTitle = "URL 추가"
394-
state.alertMessage = "웹페이지 URL을 입력해주세요."
393+
state.alertTitle = String(localized: "home_webpage_input_title")
394+
state.alertMessage = String(localized: "home_webpage_input_message")
395395
state.webPageURLInput = "https://"
396396
case .invalidURL:
397-
state.alertTitle = "URL 확인"
398-
state.alertMessage = "올바른 URL을 입력해주세요."
397+
state.alertTitle = String(localized: "home_invalid_url_title")
398+
state.alertMessage = String(localized: "home_invalid_url_message")
399399
case .error:
400-
state.alertTitle = "오류"
401-
state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요."
400+
state.alertTitle = String(localized: "common_error_title")
401+
state.alertMessage = String(localized: "common_error_message")
402402
case .none:
403403
state.alertTitle = ""
404404
state.alertMessage = ""
@@ -414,7 +414,7 @@ private extension HomeViewModel {
414414
) {
415415
switch type {
416416
case .deleteWebPage:
417-
state.toastMessage = "실행 취소"
417+
state.toastMessage = String(localized: "common_undo")
418418
case .none:
419419
state.toastMessage = ""
420420
}

DevLog/Presentation/ViewModel/LoginViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ private extension LoginViewModel {
7575
_ state: inout State,
7676
isPresented: Bool,
7777
) {
78-
state.alertTitle = "오류"
79-
state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요."
78+
state.alertTitle = String(localized: "common_error_title")
79+
state.alertMessage = String(localized: "common_error_message")
8080
state.showAlert = isPresented
8181
}
8282
}

DevLog/Presentation/ViewModel/MainViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ private extension MainViewModel {
7777
_ state: inout State,
7878
isPresented: Bool
7979
) {
80-
state.alertTitle = "오류"
81-
state.alertMessage = "알림 배지를 불러오는 중 문제가 발생했습니다."
80+
state.alertTitle = String(localized: "common_error_title")
81+
state.alertMessage = String(localized: "main_alert_badge_error_message")
8282
state.showAlert = isPresented
8383
}
8484

DevLog/Presentation/ViewModel/ProfileViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ private extension ProfileViewModel {
362362
_ state: inout State,
363363
isPresented: Bool
364364
) {
365-
state.alertTitle = "오류"
366-
state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요."
365+
state.alertTitle = String(localized: "common_error_title")
366+
state.alertMessage = String(localized: "common_error_message")
367367
state.showAlert = isPresented
368368
}
369369

DevLog/Presentation/ViewModel/PushNotificationListViewModel.swift

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,16 @@ private extension PushNotificationListViewModel {
301301
_ state: inout State,
302302
isPresented: Bool
303303
) {
304-
state.alertTitle = "오류"
305-
state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요."
304+
state.alertTitle = String(localized: "common_error_title")
305+
state.alertMessage = String(localized: "common_error_message")
306306
state.showAlert = isPresented
307307
}
308308

309309
func setToast(
310310
_ state: inout State,
311311
isPresented: Bool
312312
) {
313-
state.toastMessage = "실행 취소"
313+
state.toastMessage = String(localized: "common_undo")
314314
state.showToast = isPresented
315315
}
316316

@@ -357,8 +357,8 @@ private extension PushNotificationListViewModel {
357357
extension PushNotificationQuery.SortOrder {
358358
var title: String {
359359
switch self {
360-
case .latest: return "최신순"
361-
case .oldest: return "예전순"
360+
case .latest: return String(localized: "push_sort_latest")
361+
case .oldest: return String(localized: "push_sort_oldest")
362362
}
363363
}
364364
}
@@ -375,11 +375,17 @@ extension PushNotificationQuery.TimeFilter {
375375
var title: String {
376376
switch self {
377377
case .none:
378-
return "전체"
378+
return String(localized: "push_timefilter_all")
379379
case .hours(let value):
380-
return "최근 \(value)시간"
380+
return String.localizedStringWithFormat(
381+
String(localized: "push_timefilter_hours_format"),
382+
Int64(value)
383+
)
381384
case .days(let value):
382-
return "최근 \(value)"
385+
return String.localizedStringWithFormat(
386+
String(localized: "push_timefilter_days_format"),
387+
Int64(value)
388+
)
383389
}
384390
}
385391

DevLog/Presentation/ViewModel/PushNotificationSettingsViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ extension PushNotificationSettingsViewModel {
150150
_ state: inout State,
151151
isPresented: Bool
152152
) {
153-
state.alertTitle = "오류"
154-
state.alertMessage = "문제가 발생했습니다. 잠시 후 다시 시도해주세요."
153+
state.alertTitle = String(localized: "common_error_title")
154+
state.alertMessage = String(localized: "common_error_message")
155155
state.showAlert = isPresented
156156
}
157157

0 commit comments

Comments
 (0)