Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

refactor(ios): extract language settings

leepokai86722c21bd24
diff --git a/apps/Codync.xcodeproj/project.pbxproj b/apps/Codync.xcodeproj/project.pbxproj
index 0b1b29e1..32041adb 100644
--- a/apps/Codync.xcodeproj/project.pbxproj
+++ b/apps/Codync.xcodeproj/project.pbxproj
@@ -28,6 +28,7 @@
501377099B6CF42761B230CB /* WelcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57A7C09154869DD84BACE19 /* WelcomeView.swift */; };
52CF04B855C6AAEC47B75B8F /* CodyncKit in Frameworks */ = {isa = PBXBuildFile; productRef = 1285DDFA0390A76ECDAAD6C0 /* CodyncKit */; };
54CEEA0734C2940E2D9FAC7D /* AXTree.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D13418ABB5FD7CFC087677 /* AXTree.swift */; };
+ 5A56EF5D36D12ACCEA100642 /* LanguageSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73D324231A9BCE79C84C0403 /* LanguageSettings.swift */; };
5C9AE497DA83EB32AEC9057C /* OpenBotIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C4EB0DBA2F08CD7C0E25E30 /* OpenBotIntent.swift */; };
5CF8180C760CFAE49CF4B8C6 /* CodyncBot-cloud-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AAD970B8394F4EDFB85A8936 /* CodyncBot-cloud-Tint.ttf */; };
5FD48874687C2D18B31C7C01 /* CodyncBot-pebble-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1FECC371F3CD98687C0B69FA /* CodyncBot-pebble-Tint.ttf */; };
@@ -135,6 +136,7 @@
6BC00039A6C2C0D3F39A5F67 /* ComputerStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComputerStatus.swift; sourceTree = "<group>"; };
6D734BEE7CD3F84677B0218B /* Widgets.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = Widgets.appex; sourceTree = BUILT_PRODUCTS_DIR; };
6FC76D28AB02DF1427D530ED /* LaunchSplash.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchSplash.swift; sourceTree = "<group>"; };
+ 73D324231A9BCE79C84C0403 /* LanguageSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageSettings.swift; sourceTree = "<group>"; };
741B706007BA1B91CB853699 /* Screen.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Screen.app; sourceTree = BUILT_PRODUCTS_DIR; };
7B7E845BA1B8696B266CF578 /* NotificationService.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = NotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };
7D8961FADA8810B6CC479705 /* WidgetSetupDemo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetSetupDemo.swift; sourceTree = "<group>"; };
@@ -291,6 +293,7 @@
0814BD0C30F01A163FBDF896 /* AppearanceSettings.swift */,
0582B6169BFC36E4BCD51C0D /* BotListView.swift */,
6BC00039A6C2C0D3F39A5F67 /* ComputerStatus.swift */,
+ 73D324231A9BCE79C84C0403 /* LanguageSettings.swift */,
6FC76D28AB02DF1427D530ED /* LaunchSplash.swift */,
ECD0B4EA4BBA2BB2826C4362 /* PairingView.swift */,
B6E13F8EA6C7B0DA4D899FEE /* RootView.swift */,
@@ -670,6 +673,7 @@
01A1F820EFEE49A8FCCFC3F3 /* BotListView.swift in Sources */,
7C20764DC05D499075BC5E8C /* CodyncApp.swift in Sources */,
2002C16E427B4E4E7279E1C4 /* ComputerStatus.swift in Sources */,
+ 5A56EF5D36D12ACCEA100642 /* LanguageSettings.swift in Sources */,
35CFB641A4F10C0EBD21CB14 /* LaunchSplash.swift in Sources */,
E695251CFD06AC6F4E3396B7 /* OpenBotIntent.swift in Sources */,
719EABCBBAC0A973D729363A /* PairingView.swift in Sources */,
diff --git a/apps/ios/Views/LanguageSettings.swift b/apps/ios/Views/LanguageSettings.swift
new file mode 100644
index 00000000..db21af54
--- /dev/null
+++ b/apps/ios/Views/LanguageSettings.swift
@@ -0,0 +1,37 @@
+import SwiftUI
+import CodyncKit
+import CodyncUI
+
+struct LanguageSettings: View {
+ @AppStorage(AppLanguage.storageKey, store: AppLanguage.defaults) private var appLanguageRaw = AppLanguage.system.rawValue
+
+ var body: some View {
+ CardSection("Language", footer: languageFooter) {
+ ValueRow("App language") {
+ ChoicePicker(selection: appLanguage, options: AppLanguage.allCases.map {
+ ($0, AppLanguage.menuTitle($0, preference: appLanguage.wrappedValue, systemIsChinese: AppLanguage.systemIsChinese()))
+ })
+ }
+ }
+ }
+
+ /// Follow system names the script the iPhone is using, so Traditional is a choice of its own.
+ private var languageFooter: String {
+ switch AppLanguage.systemScript() {
+ case .hant:
+ "System language is Traditional Chinese. \"Follow system\" matches the iPhone. You can switch this app to Simplified Chinese or English."
+ case .hans:
+ "System language is Simplified Chinese. \"Follow system\" matches the iPhone. You can switch this app to Traditional Chinese or English."
+ case nil:
+ "System language is English. \"Follow system\" matches the iPhone. You can switch this app to Simplified or Traditional Chinese."
+ }
+ }
+
+ private var appLanguage: Binding<AppLanguage> {
+ Binding(
+ get: { AppLanguage(rawValue: appLanguageRaw) ?? .system },
+ set: { appLanguageRaw = $0.rawValue }
+ )
+ }
+
+}
diff --git a/apps/ios/Views/SettingsView.swift b/apps/ios/Views/SettingsView.swift
index add96a02..6f0294f5 100644
--- a/apps/ios/Views/SettingsView.swift
+++ b/apps/ios/Views/SettingsView.swift
@@ -21,7 +21,6 @@ struct SettingsView: View {
@State private var confirmStartOver = false
@State private var voice: VoiceTarget?
@State private var aboutAnalytics = false
- @AppStorage(AppLanguage.storageKey, store: AppLanguage.defaults) private var appLanguageRaw = AppLanguage.system.rawValue
var body: some View {
CardForm {
@@ -74,13 +73,7 @@ struct SettingsView: View {
AppearanceSettings()
- CardSection("Language", footer: languageFooter) {
- ValueRow("App language") {
- ChoicePicker(selection: appLanguage, options: AppLanguage.allCases.map {
- ($0, AppLanguage.menuTitle($0, preference: appLanguage.wrappedValue, systemIsChinese: AppLanguage.systemIsChinese()))
- })
- }
- }
+ LanguageSettings()
CardSection("Notifications", footer: "Get a result summary, a request for input, or a failure notice. Notification previews follow your iOS settings.") {
Toggle(isOn: $notificationsEnabled) { Text(L10n.tr("Push notifications")) }
@@ -184,25 +177,6 @@ struct SettingsView: View {
}
- /// Follow system names the script the iPhone is using, so Traditional is a choice of its own.
- private var languageFooter: String {
- switch AppLanguage.systemScript() {
- case .hant:
- "System language is Traditional Chinese. \"Follow system\" matches the iPhone. You can switch this app to Simplified Chinese or English."
- case .hans:
- "System language is Simplified Chinese. \"Follow system\" matches the iPhone. You can switch this app to Traditional Chinese or English."
- case nil:
- "System language is English. \"Follow system\" matches the iPhone. You can switch this app to Simplified or Traditional Chinese."
- }
- }
-
- private var appLanguage: Binding<AppLanguage> {
- Binding(
- get: { AppLanguage(rawValue: appLanguageRaw) ?? .system },
- set: { appLanguageRaw = $0.rawValue }
- )
- }
-
private struct VoiceTarget: Identifiable {
let store: BotStore
let id: String