From e4f3e21615e3ccbdcde88652a3993432cc12e592 Mon Sep 17 00:00:00 2001 From: Kaede Akino Date: Wed, 9 Sep 2026 20:58:52 +0800 Subject: [PATCH] Fix model role localization and skill wording --- Termind.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- Termind/Features/AI/ConversationViews.swift | 2 +- .../Features/Settings/ModelRoleSettings.swift | 2 +- Termind/Resources/Localizable.xcstrings | 16 +++++++++++++--- TermindTests/AppLanguageTests.swift | 12 ++++++++++++ 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Termind.xcodeproj/project.pbxproj b/Termind.xcodeproj/project.pbxproj index c35e2c12..dbcd720e 100644 --- a/Termind.xcodeproj/project.pbxproj +++ b/Termind.xcodeproj/project.pbxproj @@ -675,7 +675,7 @@ repositoryURL = "https://github.com/AkinoKaede/AgentKit.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 0.6.0; + minimumVersion = 0.6.1; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/Termind.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Termind.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index a4807c5d..d4878bdc 100644 --- a/Termind.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Termind.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/AkinoKaede/AgentKit.git", "state" : { - "revision" : "ad0ab2f4f707657611faa671d41f229ff019d4e8", - "version" : "0.6.0" + "revision" : "41289294a7619d1d593c80d59f348f84f22a3126", + "version" : "0.6.1" } }, { diff --git a/Termind/Features/AI/ConversationViews.swift b/Termind/Features/AI/ConversationViews.swift index a1337e39..c3ee6ece 100644 --- a/Termind/Features/AI/ConversationViews.swift +++ b/Termind/Features/AI/ConversationViews.swift @@ -1033,7 +1033,7 @@ struct ComposerView: View { commands.append( ChatSlashCommand( id: "skill", displayName: String(localized: "Skill"), - summary: String(localized: "Use an installed procedure"), + summary: String(localized: "Use an installed skill"), icon: .symbol(SkillChip.symbol), argumentHint: String(localized: "skill") )) diff --git a/Termind/Features/Settings/ModelRoleSettings.swift b/Termind/Features/Settings/ModelRoleSettings.swift index 32909107..aa2c4bea 100644 --- a/Termind/Features/Settings/ModelRoleSettings.swift +++ b/Termind/Features/Settings/ModelRoleSettings.swift @@ -83,6 +83,6 @@ private struct RolePicker: View { guard role == .chat, app.aiConfiguration.assignment(for: .chat) == nil, let resolved = app.aiConfiguration.resolve(.chat) else { return role.detail } - return "\(role.detail) Currently \(resolved.model.label) on \(resolved.provider.name)." + return String(localized: "\(role.detail) Currently \(resolved.model.label) on \(resolved.provider.name).") } } diff --git a/Termind/Resources/Localizable.xcstrings b/Termind/Resources/Localizable.xcstrings index 3443f678..f7f0970f 100644 --- a/Termind/Resources/Localizable.xcstrings +++ b/Termind/Resources/Localizable.xcstrings @@ -239,6 +239,16 @@ } } }, + "%@ Currently %@ on %@." : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "%1$@当前使用%3$@提供的%2$@。" + } + } + } + }, "%@ through %@ · %@ effort" : { "localizations" : { "en" : { @@ -12812,14 +12822,14 @@ } } }, - "Use an installed procedure" : { - "comment" : "Command to use an installed procedure.", + "Use an installed skill" : { + "comment" : "Command to use an installed skill.", "isCommentAutoGenerated" : true, "localizations" : { "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "使用已安装的流程" + "value" : "使用已安装的技能" } } } diff --git a/TermindTests/AppLanguageTests.swift b/TermindTests/AppLanguageTests.swift index f62a0fc9..e484b0ca 100644 --- a/TermindTests/AppLanguageTests.swift +++ b/TermindTests/AppLanguageTests.swift @@ -115,6 +115,18 @@ struct AppLanguageTests { } } + @Test + func automaticModelCaptionResolvesInChineseAndPreservesModelAndProvider() throws { + let path = try #require(Bundle.main.path(forResource: "zh-Hans", ofType: "lproj")) + let bundle = try #require(Bundle(path: path)) + let detail = "用于对话、工具和助手侧边栏。" + let model = "model-example" + let provider = "Example Provider" + let caption = String(localized: "\(detail) Currently \(model) on \(provider).", bundle: bundle) + + #expect(caption == "用于对话、工具和助手侧边栏。当前使用Example Provider提供的model-example。") + } + @Test func countedToolResourcesUseCatalogPluralRules() throws { let repository = URL(fileURLWithPath: #filePath)