parent
032145bf04
commit
c8e9fbb9f2
@ -1,5 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleLocalizations</key>
|
||||
<array>
|
||||
<string>en</string>
|
||||
<string>zh-Hans</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -0,0 +1,69 @@
|
||||
import SwiftUI
|
||||
|
||||
struct LanguageSettingsView: View {
|
||||
@ObservedObject private var languageManager = LanguageManager.shared
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
List {
|
||||
Section(header: Text("select_language".localized).font(.headline)) {
|
||||
ForEach(Language.allCases, id: \.self) { language in
|
||||
HStack {
|
||||
Text(language.flag)
|
||||
.font(.title2)
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(language.displayName)
|
||||
.font(.body)
|
||||
.fontWeight(.medium)
|
||||
|
||||
Text(language.rawValue.uppercased())
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
if languageManager.currentLanguage == language {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
.font(.title2)
|
||||
}
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
languageManager.switchLanguage(to: language)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Section(footer: Text("language_changes_info".localized).font(.caption).foregroundColor(.secondary)) {
|
||||
HStack {
|
||||
Image(systemName: "info.circle")
|
||||
.foregroundColor(.blue)
|
||||
Text(String(format: "current_language".localized, languageManager.currentLanguage.displayName))
|
||||
.font(.body)
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle("language_settings".localized)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
Button("done".localized) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct LanguageSettingsView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
LanguageSettingsView()
|
||||
}
|
||||
}
|
||||
#endif
|
@ -0,0 +1,39 @@
|
||||
// English Localization Strings
|
||||
|
||||
// App Title
|
||||
"app_title" = "MyQrCode";
|
||||
|
||||
// Scanner View
|
||||
"scanner_title" = "Barcode Scanner";
|
||||
"scan_instruction" = "Place QR code or barcode in the frame";
|
||||
"detected_codes" = "Codes Detected";
|
||||
"auto_result_1s" = "Result will be shown in 1 second";
|
||||
"select_code_instruction" = "Tap green markers to select the code to decode";
|
||||
"rescan_button" = "Rescan";
|
||||
"close_button" = "Close";
|
||||
|
||||
// Scanning Line Styles
|
||||
"style_modern" = "Modern Tech";
|
||||
"style_classic" = "Classic Simple";
|
||||
"style_neon" = "Neon Cool";
|
||||
"style_minimal" = "Minimalist";
|
||||
"style_retro" = "Retro Style";
|
||||
|
||||
// Content View
|
||||
"main_title" = "Barcode Scanner";
|
||||
"start_scan_button" = "Start Scanning";
|
||||
"scan_result" = "Scan Result:";
|
||||
|
||||
// Error Messages
|
||||
"scan_error_title" = "Scan Error";
|
||||
"scan_error_message" = "Your device does not support scanning QR codes. Please use a device with a camera.";
|
||||
|
||||
// Test Button
|
||||
"test_auto_select" = "Test Auto Select";
|
||||
|
||||
// Language Settings
|
||||
"select_language" = "Select Language";
|
||||
"language_changes_info" = "Language changes will take effect immediately";
|
||||
"current_language" = "Current Language: %@";
|
||||
"language_settings" = "Language Settings";
|
||||
"done" = "Done";
|
@ -0,0 +1,39 @@
|
||||
// 中文本地化字符串
|
||||
|
||||
// 应用标题
|
||||
"app_title" = "MyQrCode";
|
||||
|
||||
// 扫描视图
|
||||
"scanner_title" = "条码扫描器";
|
||||
"scan_instruction" = "将二维码或条形码放入框内";
|
||||
"detected_codes" = "检测到条码";
|
||||
"auto_result_1s" = "1秒后自动显示结果";
|
||||
"select_code_instruction" = "点击绿色标记选择要解码的条码";
|
||||
"rescan_button" = "重新扫描";
|
||||
"close_button" = "关闭";
|
||||
|
||||
// 扫描线样式
|
||||
"style_modern" = "现代科技";
|
||||
"style_classic" = "经典简约";
|
||||
"style_neon" = "霓虹炫酷";
|
||||
"style_minimal" = "极简主义";
|
||||
"style_retro" = "复古风格";
|
||||
|
||||
// 主视图
|
||||
"main_title" = "条码扫描器";
|
||||
"start_scan_button" = "开始扫描";
|
||||
"scan_result" = "扫描结果:";
|
||||
|
||||
// 错误信息
|
||||
"scan_error_title" = "扫描失败";
|
||||
"scan_error_message" = "您的设备不支持扫描二维码。请使用带相机的设备。";
|
||||
|
||||
// 测试按钮
|
||||
"test_auto_select" = "测试自动选择";
|
||||
|
||||
// 语言设置
|
||||
"select_language" = "选择语言";
|
||||
"language_changes_info" = "语言更改将立即生效";
|
||||
"current_language" = "当前语言: %@";
|
||||
"language_settings" = "语言设置";
|
||||
"done" = "完成";
|
Loading…
Reference in new issue