Skip to content

Commit dc1d1f7

Browse files
authored
[#341] 영어 로컬라이제이션을 구현한다 (#342)
* chore: 영어 추가 * feat: HomeView 및 하단 탭바 지역화 * feat: 취소 버튼에 대해 지역화 * feat: 얼럿의 확인 버튼에 대해 지역화 * feat: 취소, 확인 문자열의 키에 대해 지역화 * chore: xcstrings 파일 번역 완료 * chore: 로컬라이제이션 키 정리 및 영문 xcstrings 번역 추가 * feat: 화면 문자열 하드코딩 제거 및 로컬라이제이션 적용 * refactor: Today 섹션 생성 로직을 SummaryScope 기반으로 정리 * feat: '업데이트' 어순을 언어에 맞게 수정 * feat: 시간 표시에 지역화 설정 * fix: id가 scope로 지정되어 있어 .all로 되어있는 부분에 UI가 문제 생길 수 있는 형태를 개선 * chore: 불필요 파일 제거 * chore: 의존성 업데이트
1 parent a566f66 commit dc1d1f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4726
-3647
lines changed

DevLog.xcodeproj/project.pbxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
hasScannedForEncodings = 0;
150150
knownRegions = (
151151
ko,
152+
en,
152153
);
153154
mainGroup = DFD48AF72DC4D6E2005905C5;
154155
minimizedProjectReferenceProxies = 1;

DevLog/App/RootView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct RootView: View {
3333
get: { viewModel.state.showAlert },
3434
set: { viewModel.send(.setAlert($0)) }
3535
)) {
36-
Button("확인", role: .cancel) { }
36+
Button(String(localized: "common_close"), role: .cancel) { }
3737
} message: {
3838
Text(viewModel.state.alertMessage)
3939
}

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

0 commit comments

Comments
 (0)