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
8 changes: 7 additions & 1 deletion TaiwanEEW.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
};
buildConfigurationList = B40038E728743FAB0095D49F /* Build configuration list for PBXProject "TaiwanEEW" */;
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
developmentRegion = "zh-Hant";
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -486,11 +486,13 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
Expand Down Expand Up @@ -542,10 +544,12 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
Expand All @@ -561,6 +565,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_ASSET_PATHS = "\"TaiwanEEW/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = TaiwanEEW/Info.plist;
Expand Down Expand Up @@ -605,6 +610,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_ASSET_PATHS = "\"TaiwanEEW/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = TaiwanEEW/Info.plist;
Expand Down
29 changes: 16 additions & 13 deletions TaiwanEEW/Components/Alert Screen/EEWDetailBlock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//
// Created by 林子祐 on 2024/7/5.
//
/// 2026/08/24 Changelog - Albert
/// - Added missing localizations for this part 新增字串的英文及日文翻譯
///

import SwiftUI
import XMLCoder
Expand Down Expand Up @@ -86,17 +89,17 @@ struct EEWDetailBlock: View {
HStack(alignment: .lastTextBaseline){
var title: String {
if(status == "exercise"){
return "演練 Drill"
return "alert-drill".localized
} else if(status == "test" && !TaiwanEEWApp.DEBUG){
return "測試中 Testing"
return "alert-test".localized
} else if (msgType == "system") {
return "系統 System"
return "alert-sys".localized
} else if(msgType == "cancel"){
return "預警取消 Canceled"
return "alert-canceled".localized
} else if(msgType == "error"){
return "預警錯誤 Error"
return "alert-false".localized
} else {
return NSLocalizedString("地震速報", comment: "") // localize "alert-title-string"
return "alert-title-string".localized // localize "alert-title-string"
}
}
Text(title).font(.system(size: UIScreen.isZoomed ? 23 : 28).bold())
Expand All @@ -123,7 +126,7 @@ struct EEWDetailBlock: View {
}

HStack(alignment: .firstTextBaseline){
Text("\(originTimeFormattedStr) 發生")
Text("\(originTimeFormattedStr) 發生") // translated!
// .offset(y:3)
.foregroundStyle(Color("TimeText"))
.font(.system(size: UIScreen.isZoomed ? 12 : 18))
Expand Down Expand Up @@ -196,21 +199,21 @@ struct EEWDetailBlock: View {

func fetchOceanData(lat: Double, lon: Double)-> String {
if(lat >= 24.31343 && lon >= 121.76857){
return "東北部海域"
return "NE-sea".localized
}
if(lat >= 23.43494 && lat <= 24.31343 && lon >= 121){
return "東部海域"
return "E-sea".localized
}
if(lat >= 22.24595 && lat <= 23.43494 && lon >= 120.79958){
return "東南部海域"
return "SE-sea".localized
}
if(lat >= 24.73429 && lon <= 121.76857){
return "北部海域"
return "N-sea".localized
}
if(lat >= 23.53352 && lat <= 24.73429 && lon <= 121){
return "中部海域"
return "C-sea".localized
}
return "南部海域"
return "S-sea".localized
}
}

Expand Down
19 changes: 19 additions & 0 deletions TaiwanEEW/Extensions/String.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// String.swift
// TaiwanEEW
//
// Created by Albert Huang on 2026/8/24.
//


extension String {
var localized: String {
NSLocalizedString(self, comment: "")
}

// func localized(with arguments: CVarArg...) -> String {
// withVaList(arguments) { vaList in
// NSString(format: self.localized, locale: .current, arguments: vaList) as String
// }
// }
}
12 changes: 6 additions & 6 deletions TaiwanEEW/GoogleService-Info.plist.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>YOUR_FIREBASE_API_KEY</string>
<string>AIzaSyDummyKeyForLocalBuildTesting00</string>
<key>GCM_SENDER_ID</key>
<string>YOUR_SENDER_ID</string>
<string>123456789012</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.example.YourApp</string>
<string>com.example.dummyapp</string>
<key>PROJECT_ID</key>
<string>your-firebase-project-id</string>
<string>dummy-project-id</string>
<key>STORAGE_BUCKET</key>
<string>your-firebase-project-id.appspot.com</string>
<string>dummy-project-id.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
Expand All @@ -35,7 +35,7 @@
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:000000000000:ios:0000000000000000000000</string>
<string>1:123456789012:ios:0000000000000000000000</string>
<key>CLIENT_ID</key>
<string>000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
Expand Down
16 changes: 8 additions & 8 deletions TaiwanEEW/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RCApiKey</key>
<string>$(RC_API_KEY)</string>
<key>CognitoPoolID</key>
<string>$(COGNITO_POOL_ID)</string>
<key>AWSRegion</key>
<string>$(AWS_REGION)</string>
<key>AWSAccountID</key>
<string>$(AWS_ACCOUNT_ID)</string>
<key>SNSPlatformAppName</key>
<string>$(SNS_APP_NAME)</string>
<key>AWSRegion</key>
<string>$(AWS_REGION)</string>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.joedev.TaiwanEEW.refresh</string>
<string>com.joedev.TaiwanEEW.locationUpdate</string>
</array>
<key>CognitoPoolID</key>
<string>$(COGNITO_POOL_ID)</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
<key>RCApiKey</key>
<string>$(RC_API_KEY)</string>
<key>SNSPlatformAppName</key>
<string>$(SNS_APP_NAME)</string>
<key>UIAppFonts</key>
<array>
<string>JetBrainsMono-Bold-Italic.ttf</string>
Expand Down
Loading