언어 설정 화면 추가 및 언어 헤더 적용

설정에서 시스템/한국어/영어/일본어 선택을 지원한다.

선택 시 Accept-Language 헤더와 UI locale을 즉시 반영한다.

언어 변경 후 스플래시를 거쳐 메인으로 소프트 재시작한다.
This commit is contained in:
Yu Sung
2025-12-16 22:56:37 +09:00
parent b2c94a44d9
commit 0285f62ecb
22 changed files with 512 additions and 61 deletions

View File

@@ -43,7 +43,7 @@ class AppState: ObservableObject {
@Published var purchasedContentId = 0
@Published var purchasedContentOrderType = OrderType.KEEP
@Published var isChangeAdultContentVisible = false
@Published var isRestartApp = false
@Published var startTab: HomeViewModel.CurrentTab = .home
@Published var marketingUtmSource = ""
@@ -74,4 +74,13 @@ class AppState: ObservableObject {
self.appStep = .main
}
}
// ( -> ) UI
func softRestart() {
isRestartApp = true
setAppStep(step: .splash)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
self.setAppStep(step: .main)
}
}
}

View File

@@ -26,6 +26,8 @@ enum AppStep {
case settings
case languageSettings
case notices
case noticeDetail(notice: NoticeItem)

View File

@@ -19,9 +19,12 @@ struct SodaLiveApp: App {
@ObservedObject var viewModel = AppViewModel()
@StateObject var canPgPaymentViewModel = CanPgPaymentViewModel()
@StateObject private var languageEnvironment = LanguageContainer.environment
init() {
configureImageCache()
// ,
LanguageHeaderProvider.initialize()
}
private func configureImageCache() {
@@ -40,6 +43,10 @@ struct SodaLiveApp: App {
var body: some Scene {
WindowGroup {
ContentView(canPgPaymentViewModel: canPgPaymentViewModel)
.environment(\.locale, languageEnvironment.locale)
.task {
await LanguageContainer.service.bootstrap()
}
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification)) { _ in
CreatorCommunityMediaPlayerManager.shared.pauseContent()
//