Refactor LanguageManager initialization to set isInitialized immediately, improving performance. Add debug print statements for localization processes in LaunchScreenView to aid in troubleshooting. Update localization strings across multiple languages to reflect the new app name "QR Code & Barcode Plus" and enhance user experience.

main
v504 2 months ago
parent 2e6fcc7798
commit a3ee877aed

@ -0,0 +1,73 @@
# 应用名称更新总结
## 更新内容
将应用名称从 "MyQrCode" 更改为 "QR Code & Barcode Plus"
## 修改的文件
### 1. 本地化字符串文件 (Localizable.strings)
更新了所有支持语言的 `app_title``app_name` 键值:
**支持的语言**:
- 🇺🇸 英语 (en.lproj)
- 🇨🇳 简体中文 (zh-Hans.lproj)
- 🇩🇪 德语 (de.lproj)
- 🇪🇸 西班牙语 (es.lproj)
- 🇫🇷 法语 (fr.lproj)
- 🇮🇹 意大利语 (it.lproj)
- 🇯🇵 日语 (ja.lproj)
- 🇰🇷 韩语 (ko.lproj)
- 🇵🇹 葡萄牙语 (pt.lproj)
- 🇷🇺 俄语 (ru.lproj)
- 🇹🇭 泰语 (th.lproj)
**更新的键值**:
```strings
"app_title" = "QR Code & Barcode Plus";
"app_name" = "QR Code & Barcode Plus";
```
### 2. InfoPlist.strings 文件
更新了所有语言的 `CFBundleDisplayName``CFBundleName`
```strings
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
```
## 影响范围
### ✅ 已更新的显示位置
1. **启动界面** - 应用标题显示
2. **系统设置** - 应用显示名称
3. **应用商店** - 应用名称
4. **所有本地化语言** - 11种语言支持
### 📱 用户体验
- 用户在主屏幕上看到的应用名称将显示为 "QR Code & Barcode Plus"
- 启动界面中的应用标题将显示为 "QR Code & Barcode Plus"
- 所有语言环境下都保持一致的名称显示
## 技术细节
### 本地化实现
- 使用 `"app_title".localized` 在启动界面显示应用名称
- 通过 `CFBundleDisplayName` 设置系统级应用显示名称
- 支持动态语言切换,名称会根据用户语言设置自动更新
### 构建状态
- ✅ 项目构建成功
- ✅ 无编译错误
- ✅ 所有本地化文件已更新
## 验证方法
1. 运行应用,检查启动界面显示的应用名称
2. 检查主屏幕上的应用图标名称
3. 切换系统语言,验证多语言支持
4. 检查设置中的应用信息显示
## 完成时间
2025年9月4日
---
**注意**: 应用名称更新已完成,所有相关文件都已同步更新,确保在不同语言环境下都能正确显示新的应用名称。

@ -89,10 +89,8 @@ class LanguageManager: ObservableObject {
private init() {
loadLanguage()
//
DispatchQueue.main.async {
self.isInitialized = true
}
//
isInitialized = true
}
//
@ -240,15 +238,28 @@ class LanguageManager: ObservableObject {
languageToUse = currentLanguage.rawValue
}
//
#if DEBUG
print("🔍 Localization Debug - Key: \(key), Language: \(languageToUse), Current: \(currentLanguage.rawValue)")
#endif
//
if let path = bundle.path(forResource: languageToUse, ofType: "lproj"),
let languageBundle = Bundle(path: path) {
let localizedString = languageBundle.localizedString(forKey: key, value: nil, table: nil)
#if DEBUG
print("🔍 Found bundle at: \(path), Result: \(localizedString)")
#endif
// key
if localizedString != key {
return localizedString
}
} else {
#if DEBUG
print("❌ Bundle not found for language: \(languageToUse)")
#endif
}
// 退
@ -256,6 +267,10 @@ class LanguageManager: ObservableObject {
let languageBundle = Bundle(path: path) {
let englishString = languageBundle.localizedString(forKey: key, value: nil, table: nil)
#if DEBUG
print("🔍 Fallback to English, Result: \(englishString)")
#endif
// key
if englishString != key {
return englishString
@ -263,6 +278,9 @@ class LanguageManager: ObservableObject {
}
// 退key
#if DEBUG
print("❌ No localization found for key: \(key), returning key itself")
#endif
return key
}
}

@ -145,22 +145,28 @@ struct LaunchScreenView: View {
//
VStack(spacing: 15) {
Text("app_title".localized)
.font(.system(size: 42, weight: .bold, design: .rounded))
.foregroundColor(.white)
.shadow(color: .black.opacity(0.4), radius: 3, x: 0, y: 2)
Text("app_subtitle".localized)
.font(.system(size: 20, weight: .medium))
.foregroundColor(.white.opacity(0.9))
.multilineTextAlignment(.center)
.shadow(color: .black.opacity(0.3), radius: 2, x: 0, y: 1)
.onAppear {
#if DEBUG
print("🚀 LaunchScreen - app_subtitle: \("app_subtitle".localized)")
#endif
}
Text("app_description_launch".localized)
.font(.system(size: 16, weight: .regular))
.foregroundColor(.white.opacity(0.7))
.multilineTextAlignment(.center)
.shadow(color: .black.opacity(0.2), radius: 1, x: 0, y: 1)
.onAppear {
#if DEBUG
print("🚀 LaunchScreen - app_description_launch: \("app_description_launch".localized)")
#endif
}
}
.opacity(textOpacity)
}
@ -194,6 +200,11 @@ struct LaunchScreenView: View {
.font(.system(size: 16, weight: .medium))
.foregroundColor(.white.opacity(0.8))
.opacity(textOpacity)
.onAppear {
#if DEBUG
print("🚀 LaunchScreen - initializing: \("initializing".localized)")
#endif
}
//
HStack(spacing: 15) {

@ -5,6 +5,6 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "Diese App benötigt Zugriff auf Kontakte, um Kontaktinformationen hinzuzufügen";

@ -1,5 +1,5 @@
// App
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
"settings" = "Einstellungen";
"scan" = "Scannen";
"create" = "Erstellen";
@ -178,7 +178,7 @@
"allowed_characters" = "Allowed characters: %@";
"app_description" = "Scan QR codes and barcodes with ease";
"app_description_long" = "QR Scanner is a powerful QR code and barcode scanning app that supports multiple barcode format recognition and creation.";
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "QR-Code Scanner & Generator";
"app_description_launch" = "Professionelle QR-Code Lösung";
"initializing" = "Initialisierung...";

@ -5,8 +5,8 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "This app needs access to contacts to add contact information";
"NSCalendarsUsageDescription" = "This app needs access to calendar to add events";
"NSCalendarsWriteOnlyAccessUsageDescription" = "This app needs write-only access to add calendar events";

@ -1,7 +1,7 @@
// English Localization Strings
// App Title
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "QR Code Scanner & Generator";
"app_description_launch" = "Professional QR Code Solution";
@ -711,7 +711,7 @@
"silver" = "Silver";
// App Name
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
// Navigation
"back" = "Back";

@ -5,6 +5,6 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "Esta aplicación necesita acceso a los contactos para agregar información de contacto";

@ -1,5 +1,5 @@
// App
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
"settings" = "Configuración";
"scan" = "Escanear";
"create" = "Crear";
@ -178,7 +178,7 @@
"allowed_characters" = "Allowed characters: %@";
"app_description" = "Scan QR codes and barcodes with ease";
"app_description_long" = "QR Scanner is a powerful QR code and barcode scanning app that supports multiple barcode format recognition and creation.";
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "Escáner y Generador de Códigos QR";
"app_description_launch" = "Solución Profesional de Códigos QR";
"initializing" = "Inicializando...";

@ -5,6 +5,6 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "Cette application a besoin d'accéder aux contacts pour ajouter des informations de contact";

@ -1,5 +1,5 @@
// App
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
"settings" = "Paramètres";
"scan" = "Scanner";
"create" = "Créer";
@ -178,7 +178,7 @@
"allowed_characters" = "Allowed characters: %@";
"app_description" = "Scan QR codes and barcodes with ease";
"app_description_long" = "QR Scanner is a powerful QR code and barcode scanning app that supports multiple barcode format recognition and creation.";
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "Scanner et Générateur de QR Code";
"app_description_launch" = "Solution Professionnelle de QR Code";
"initializing" = "Initialisation...";

@ -5,6 +5,6 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "Questa app ha bisogno di accedere ai contatti per aggiungere informazioni di contatto";

@ -1,5 +1,5 @@
// App
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
"settings" = "Impostazioni";
"scan" = "Scansiona";
"create" = "Crea";
@ -178,7 +178,7 @@
"allowed_characters" = "Allowed characters: %@";
"app_description" = "Scan QR codes and barcodes with ease";
"app_description_long" = "QR Scanner is a powerful QR code and barcode scanning app that supports multiple barcode format recognition and creation.";
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "Scanner e Generatore di Codici QR";
"app_description_launch" = "Soluzione Professionale per Codici QR";
"initializing" = "Inizializzazione...";

@ -5,6 +5,6 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "このアプリは連絡先情報を追加するために連絡先へのアクセスが必要です";

@ -1,5 +1,5 @@
// App
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
"settings" = "設定";
"scan" = "スキャン";
"create" = "作成";
@ -178,7 +178,7 @@
"allowed_characters" = "Allowed characters: %@";
"app_description" = "Scan QR codes and barcodes with ease";
"app_description_long" = "QR Scanner is a powerful QR code and barcode scanning app that supports multiple barcode format recognition and creation.";
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "QRコードスキャナージェネレーター";
"app_description_launch" = "プロフェッショナルQRコードソリューション";
"initializing" = "初期化中...";

@ -5,6 +5,6 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "이 앱은 연락처 정보를 추가하기 위해 연락처에 대한 액세스가 필요합니다";

@ -1,5 +1,5 @@
// App
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
"settings" = "설정";
"scan" = "스캔";
"create" = "생성";
@ -178,7 +178,7 @@
"allowed_characters" = "Allowed characters: %@";
"app_description" = "Scan QR codes and barcodes with ease";
"app_description_long" = "QR Scanner is a powerful QR code and barcode scanning app that supports multiple barcode format recognition and creation.";
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "QR 코드 스캐너 및 생성기";
"app_description_launch" = "전문 QR 코드 솔루션";
"initializing" = "초기화 중...";

@ -5,6 +5,6 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "Este aplicativo precisa acessar os contatos para adicionar informações de contato";

@ -1,5 +1,5 @@
// App
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
"settings" = "Configurações";
"scan" = "Escanear";
"create" = "Criar";
@ -178,7 +178,7 @@
"allowed_characters" = "Allowed characters: %@";
"app_description" = "Scan QR codes and barcodes with ease";
"app_description_long" = "QR Scanner is a powerful QR code and barcode scanning app that supports multiple barcode format recognition and creation.";
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "Scanner e Gerador de Códigos QR";
"app_description_launch" = "Solução Profissional de Códigos QR";
"initializing" = "Inicializando...";

@ -5,6 +5,6 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "Это приложение требует доступ к контактам для добавления контактной информации";

@ -1,5 +1,5 @@
// App
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
"settings" = "Настройки";
"scan" = "Сканировать";
"create" = "Создать";
@ -178,7 +178,7 @@
"allowed_characters" = "Allowed characters: %@";
"app_description" = "Scan QR codes and barcodes with ease";
"app_description_long" = "QR Scanner is a powerful QR code and barcode scanning app that supports multiple barcode format recognition and creation.";
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "Сканер и Генератор QR-кодов";
"app_description_launch" = "Профессиональное решение для QR-кодов";
"initializing" = "Инициализация...";

@ -5,6 +5,6 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "แอปนี้ต้องการเข้าถึงรายชื่อติดต่อเพื่อเพิ่มข้อมูลรายชื่อติดต่อ";

@ -1,7 +1,7 @@
// Thai Localization Strings
// App Title
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "เครื่องสแกนและสร้าง QR Code";
"app_description_launch" = "โซลูชัน QR Code ระดับมืออาชีพ";
"initializing" = "กำลังเริ่มต้น...";
@ -702,7 +702,7 @@
"manage_app_permissions" = "จัดการสิทธิ์กล้องและไลบรารีรูปภาพสำหรับแอปนี้";
// ชื่อแอป
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
// การนำทาง
"back" = "กลับ";

@ -5,8 +5,8 @@
Created by dev on 2025/8/28.
*/
"CFBundleDisplayName" = "MyQrCode";
"CFBundleName" = "MyQrCode";
"CFBundleDisplayName" = "QR Code & Barcode Plus";
"CFBundleName" = "QR Code & Barcode Plus";
"NSContactsUsageDescription" = "此应用需要访问通讯录以添加联系人信息";
"NSCalendarsUsageDescription" = "此应用需要访问日历来添加事件";
"NSCalendarsWriteOnlyAccessUsageDescription" = "此应用需要只写权限来添加日历事件";

@ -1,7 +1,7 @@
// 中文本地化字符串
// 应用标题
"app_title" = "MyQrCode";
"app_title" = "QR Code & Barcode Plus";
"app_subtitle" = "二维码扫描器与生成器";
"app_description_launch" = "专业的二维码解决方案";
@ -713,7 +713,7 @@
"manage_app_permissions" = "管理此应用的相机和相册权限。";
// 应用名称
"app_name" = "MyQrCode";
"app_name" = "QR Code & Barcode Plus";
// 导航
"back" = "返回";

Loading…
Cancel
Save