Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Application/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let project = Project(
"Sources/Resource/Assets.xcassets",
"../Presentation/PresentationShared/Resources/Assets.xcassets",
"Sources/Resource/GoogleService-Info.plist",
"Sources/Resource/Localizable.xcstrings",
"../Presentation/PresentationShared/Resources/Localizable.xcstrings",
],
entitlements: .file(path: "Sources/Resource/DevLog.entitlements"),
scripts: [
Expand Down
11 changes: 8 additions & 3 deletions Application/Core/Sources/SystemTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import Foundation

public enum SystemTheme: String, Identifiable {
case automatic
Expand All @@ -17,13 +18,17 @@ public enum SystemTheme: String, Identifiable {
}

public var localizedName: String {
localizedName(in: .main)
}

public func localizedName(in bundle: Bundle) -> String {
switch self {
case .automatic:
return NSLocalizedString("system_theme_automatic", comment: "System theme: automatic")
return String(localized: "system_theme_automatic", bundle: bundle)
case .light:
return NSLocalizedString("system_theme_light", comment: "System theme: light")
return String(localized: "system_theme_light", bundle: bundle)
case .dark:
return NSLocalizedString("system_theme_dark", comment: "System theme: dark")
return String(localized: "system_theme_dark", bundle: bundle)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct LoginButton: View {
.tint(Color(asset: .accentColor))
} else {
Text(text)
.foregroundStyle(Color(asset: .textPrimary))
.foregroundStyle(.primary)
}
}
.font(.system(.body))
Expand Down
10 changes: 5 additions & 5 deletions Application/Presentation/Entry/Sources/Login/LoginFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,18 @@ private extension LoginFeature {

switch alertType {
case .emailUnavailable:
title = String(localized: "login_alert_email_unavailable_title")
message = String(localized: "login_alert_email_unavailable_message")
title = String(localized: "login_alert_email_unavailable_title", bundle: PresentationResources.bundle)
message = String(localized: "login_alert_email_unavailable_message", bundle: PresentationResources.bundle)
case .error:
title = String(localized: "common_error_title")
message = String(localized: "common_error_message")
title = String(localized: "common_error_title", bundle: PresentationResources.bundle)
message = String(localized: "common_error_message", bundle: PresentationResources.bundle)
}

return AlertState {
TextState(title)
} actions: {
ButtonState(role: .cancel) {
TextState(String(localized: "common_close"))
TextState(String(localized: "common_close", bundle: PresentationResources.bundle))
}
} message: {
TextState(message)
Expand Down
12 changes: 6 additions & 6 deletions Application/Presentation/Entry/Sources/Login/LoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ struct LoginView: View {
Spacer()

VStack(spacing: 24) {
Text(String(localized: "login_intro_title"))
Text(String(localized: "login_intro_title", bundle: PresentationResources.bundle))
.font(.title)
.fontWeight(.heavy)
.multilineTextAlignment(.center)
Text(String(localized: "login_intro_description"))
Text(String(localized: "login_intro_description", bundle: PresentationResources.bundle))
.padding(.horizontal)
.foregroundStyle(Color(asset: .textTertiary))
.multilineTextAlignment(.center)
Expand All @@ -49,23 +49,23 @@ struct LoginView: View {
signInButton(
provider: .google,
logo: Image("Google", bundle: PresentationResources.bundle),
text: String(localized: "login_google_sign_in")
text: String(localized: "login_google_sign_in", bundle: PresentationResources.bundle)
)

signInButton(
provider: .github,
logo: Image("Github", bundle: PresentationResources.bundle),
text: String(localized: "login_github_sign_in")
text: String(localized: "login_github_sign_in", bundle: PresentationResources.bundle)
)

signInButton(
provider: .apple,
logo: Image("Apple", bundle: PresentationResources.bundle),
text: String(localized: "login_apple_sign_in")
text: String(localized: "login_apple_sign_in", bundle: PresentationResources.bundle)
)
}
.padding(.bottom, 30)
Text(String(localized: "login_terms_notice"))
Text(String(localized: "login_terms_notice", bundle: PresentationResources.bundle))
.font(.caption2)
.foregroundStyle(Color.gray)
.multilineTextAlignment(.center)
Expand Down
6 changes: 3 additions & 3 deletions Application/Presentation/Entry/Sources/Main/MainFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ private extension MainFeature {

static func alertState() -> AlertState<Never> {
AlertState {
TextState(String(localized: "common_error_title"))
TextState(String(localized: "common_error_title", bundle: PresentationResources.bundle))
} actions: {
ButtonState(role: .cancel) {
TextState(String(localized: "common_close"))
TextState(String(localized: "common_close", bundle: PresentationResources.bundle))
}
} message: {
TextState(String(localized: "main_alert_badge_error_message"))
TextState(String(localized: "main_alert_badge_error_message", bundle: PresentationResources.bundle))
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions Application/Presentation/Entry/Sources/Main/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ struct MainView: View {
homeDestinationView(homeRoute)
} else {
ContentUnavailableView(
String(localized: "home_select_detail"),
String(localized: "home_select_detail", bundle: PresentationResources.bundle),
systemImage: "house"
)
}
Expand Down Expand Up @@ -280,7 +280,7 @@ struct MainView: View {
todayDestinationView(todayRoute)
} else {
ContentUnavailableView(
String(localized: "today_select_detail"),
String(localized: "today_select_detail", bundle: PresentationResources.bundle),
systemImage: "sun.max"
)
}
Expand Down Expand Up @@ -319,7 +319,7 @@ struct MainView: View {
.id(todoId)
} else {
ContentUnavailableView(
String(localized: "push_notifications_select_detail"),
String(localized: "push_notifications_select_detail", bundle: PresentationResources.bundle),
systemImage: "bell.badge"
)
.background(Color(.systemGroupedBackground).ignoresSafeArea())
Expand Down Expand Up @@ -387,13 +387,13 @@ private extension MainTab {
var title: String {
switch self {
case .home:
String(localized: "nav_home")
String(localized: "nav_home", bundle: PresentationResources.bundle)
case .today:
String(localized: "nav_today")
String(localized: "nav_today", bundle: PresentationResources.bundle)
case .notification:
String(localized: "nav_notifications")
String(localized: "nav_notifications", bundle: PresentationResources.bundle)
case .profile:
String(localized: "nav_profile")
String(localized: "nav_profile", bundle: PresentationResources.bundle)
}
}

Expand Down
12 changes: 6 additions & 6 deletions Application/Presentation/Entry/Sources/Root/RootFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -292,25 +292,25 @@ private extension RootFeature {

static func appUpdateAlertState() -> AlertState<Action.Alert> {
AlertState {
TextState(String(localized: "root_app_update_title"))
TextState(String(localized: "root_app_update_title", bundle: PresentationResources.bundle))
} actions: {
ButtonState(action: .tapUpdateButton) {
TextState(String(localized: "root_app_update_action"))
TextState(String(localized: "root_app_update_action", bundle: PresentationResources.bundle))
}
} message: {
TextState(String(localized: "root_app_update_message"))
TextState(String(localized: "root_app_update_message", bundle: PresentationResources.bundle))
}
}

static func networkDisconnectedAlertState() -> AlertState<Action.Alert> {
AlertState {
TextState(String(localized: "root_network_disconnected_title"))
TextState(String(localized: "root_network_disconnected_title", bundle: PresentationResources.bundle))
} actions: {
ButtonState(role: .cancel) {
TextState(String(localized: "common_close"))
TextState(String(localized: "common_close", bundle: PresentationResources.bundle))
}
} message: {
TextState(String(localized: "root_network_disconnected_message"))
TextState(String(localized: "root_network_disconnected_message", bundle: PresentationResources.bundle))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ struct LoginFeatureTests {
}

#expect(driver.alert == expectedAlert(
title: String(localized: "login_alert_email_unavailable_title"),
message: String(localized: "login_alert_email_unavailable_message")
title: String(localized: "login_alert_email_unavailable_title", bundle: PresentationResources.bundle),
message: String(localized: "login_alert_email_unavailable_message", bundle: PresentationResources.bundle)
))
}

Expand All @@ -110,8 +110,8 @@ struct LoginFeatureTests {
}

#expect(driver.alert == expectedAlert(
title: String(localized: "common_error_title"),
message: String(localized: "common_error_message")
title: String(localized: "common_error_title", bundle: PresentationResources.bundle),
message: String(localized: "common_error_message", bundle: PresentationResources.bundle)
))
}

Expand Down Expand Up @@ -203,7 +203,7 @@ private func expectedAlert(
TextState(title)
} actions: {
ButtonState(role: .cancel) {
TextState(String(localized: "common_close"))
TextState(String(localized: "common_close", bundle: PresentationResources.bundle))
}
} message: {
TextState(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ private final class MainStateManagementReference {

private func expectedMainErrorAlert() -> AlertState<Never> {
AlertState {
TextState(String(localized: "common_error_title"))
TextState(String(localized: "common_error_title", bundle: PresentationResources.bundle))
} actions: {
ButtonState(role: .cancel) {
TextState(String(localized: "common_close"))
TextState(String(localized: "common_close", bundle: PresentationResources.bundle))
}
} message: {
TextState(String(localized: "main_alert_badge_error_message"))
TextState(String(localized: "main_alert_badge_error_message", bundle: PresentationResources.bundle))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,14 @@ func verifyNetworkDisconnectedAlert(adapter: some RootStateDriving) async {
#expect(
adapter.snapshot
== RootStateSnapshot(
alertTitle: String(localized: "root_network_disconnected_title"),
alertMessage: String(localized: "root_network_disconnected_message"),
alertTitle: String(
localized: "root_network_disconnected_title",
bundle: PresentationResources.bundle
),
alertMessage: String(
localized: "root_network_disconnected_message",
bundle: PresentationResources.bundle
),
isNetworkConnected: false,
signIn: nil,
theme: .automatic,
Expand Down Expand Up @@ -221,14 +227,21 @@ func verifyObservedInitialValues(adapter: some RootStateDriving) async {
return snapshot.signIn == false
&& !snapshot.isNetworkConnected
&& snapshot.theme == .dark
&& snapshot.alertTitle == String(localized: "root_network_disconnected_title")
&& snapshot.alertTitle
== String(localized: "root_network_disconnected_title", bundle: PresentationResources.bundle)
}

#expect(
adapter.snapshot
== RootStateSnapshot(
alertTitle: String(localized: "root_network_disconnected_title"),
alertMessage: String(localized: "root_network_disconnected_message"),
alertTitle: String(
localized: "root_network_disconnected_title",
bundle: PresentationResources.bundle
),
alertMessage: String(
localized: "root_network_disconnected_message",
bundle: PresentationResources.bundle
),
isNetworkConnected: false,
signIn: false,
theme: .dark,
Expand Down
11 changes: 9 additions & 2 deletions Application/Presentation/Entry/Tests/Root/RootFeatureTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Core
import Foundation
import PresentationShared
import Testing

@MainActor
Expand Down Expand Up @@ -142,8 +143,14 @@ struct RootFeatureTests {

await adapter.onAppear()

#expect(adapter.snapshot.alertTitle == String(localized: "root_app_update_title"))
#expect(adapter.snapshot.alertMessage == String(localized: "root_app_update_message"))
#expect(
adapter.snapshot.alertTitle
== String(localized: "root_app_update_title", bundle: PresentationResources.bundle)
)
#expect(
adapter.snapshot.alertMessage
== String(localized: "root_app_update_message", bundle: PresentationResources.bundle)
)
}

@Test("업데이트 버튼은 App Store 열기를 요청한다")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ struct CategoryManageFeature {
}
var navigationTitle: String {
isEditing
? String(localized: "todo_manage_edit_category_title")
: String(localized: "todo_manage_add_category_title")
? String(localized: "todo_manage_edit_category_title", bundle: PresentationResources.bundle)
: String(localized: "todo_manage_add_category_title", bundle: PresentationResources.bundle)
}
var submitTitle: String {
isEditing
? String(localized: "todo_manage_save")
: String(localized: "todo_add")
? String(localized: "todo_manage_save", bundle: PresentationResources.bundle)
: String(localized: "todo_add", bundle: PresentationResources.bundle)
}
var placeholder: String {
category.name
Expand Down Expand Up @@ -213,16 +213,16 @@ private struct CategoryManageSheetFeature: Reducer {
private extension CategoryManageFeature {
static func deleteAlertState(for item: TodoCategoryItem) -> AlertState<Action.Alert> {
AlertState {
TextState(String(localized: "todo_manage_delete_category_title"))
TextState(String(localized: "todo_manage_delete_category_title", bundle: PresentationResources.bundle))
} actions: {
ButtonState(role: .cancel) {
TextState(String(localized: "common_cancel"))
TextState(String(localized: "common_cancel", bundle: PresentationResources.bundle))
}
ButtonState(role: .destructive, action: .confirmDeleteUserCategory(item)) {
TextState(String(localized: "common_delete"))
TextState(String(localized: "common_delete", bundle: PresentationResources.bundle))
}
} message: {
TextState(String(localized: "todo_manage_delete_category_message"))
TextState(String(localized: "todo_manage_delete_category_message", bundle: PresentationResources.bundle))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct CategoryManageView: View {
.listRowInsets(EdgeInsets())
}
.environment(\.editMode, .constant(.active))
.navigationTitle(String(localized: "nav_todo_manage"))
.navigationTitle(String(localized: "nav_todo_manage", bundle: PresentationResources.bundle))
.navigationBarTitleDisplayMode(.inline)
.navigationBarBackButtonHidden()
.sheet(item: $store.scope(state: \.categorySheet, action: \.categorySheet)) { sheetStore in
Expand All @@ -69,7 +69,7 @@ struct CategoryManageView: View {
Button {
store.send(.tapDoneButton, animation: .default)
} label: {
Text(String(localized: "profile_done"))
Text(String(localized: "profile_done", bundle: PresentationResources.bundle))
}
}
}
Expand Down Expand Up @@ -127,7 +127,7 @@ private struct CategoryManageSheet: View {
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button(String(localized: "common_close")) {
Button(String(localized: "common_close", bundle: PresentationResources.bundle)) {
store.send(.tapCloseButton)
}
}
Expand Down
Loading