Skip to content

Commit 2f0a357

Browse files
committed
fix: Unified translations
1 parent 61ea093 commit 2f0a357

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

Sidekick/Localizable.xcstrings

+8-8
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@
5050
}
5151
}
5252
},
53-
"A new endpoint has been selected, which has been identified as capable of native tool calling. Would you like to turn on native tool calling?" : {
53+
"A new endpoint has been selected, which has been identified as capable of native function calling. Would you like to turn on native tool calling?" : {
5454
"localizations" : {
5555
"zh-Hans" : {
5656
"stringUnit" : {
5757
"state" : "translated",
58-
"value" : "已选择一个新的端点,该端点已被确认支持原生工具调用功能。您是否要启用原生工具调用?"
58+
"value" : "已选择一个新的端点,该端点已被确认支持原生函数调用功能。您是否要启用原生函数调用?"
5959
}
6060
}
6161
}
6262
},
63-
"A new endpoint has been selected, which might not be capable of native tool calling. Would you like to turn off native tool calling?" : {
63+
"A new endpoint has been selected, which might not be capable of native function calling. Would you like to turn off native tool calling?" : {
6464
"localizations" : {
6565
"zh-Hans" : {
6666
"stringUnit" : {
6767
"state" : "translated",
68-
"value" : "已选择新端点,该端点可能不支持原生工具调用功能。是否要关闭原生工具调用?"
68+
"value" : "已选择新端点,该端点可能不支持原生函数调用功能。是否要关闭原生函数调用?"
6969
}
7070
}
7171
}
@@ -690,12 +690,12 @@
690690
}
691691
}
692692
},
693-
"Controls whether native tool calling is available for the remote model. Turn it on only when the inference provider supports native tool calling for the selected model." : {
693+
"Controls whether native function calling is available for the remote model. Turn it on only when the inference provider supports native tool calling for the selected model." : {
694694
"localizations" : {
695695
"zh-Hans" : {
696696
"stringUnit" : {
697697
"state" : "translated",
698-
"value" : "控制远程模型是否支持原生工具调用功能。仅在推理服务提供商确认所选模型支持原生工具调用时,才开启此选项。"
698+
"value" : "控制远程模型是否支持原生函数调用功能。仅在推理服务提供商确认所选模型支持原生函数调用时,才开启此选项。"
699699
}
700700
}
701701
}
@@ -2437,12 +2437,12 @@
24372437
}
24382438
}
24392439
},
2440-
"Native Tool Calling" : {
2440+
"Native Function Calling" : {
24412441
"localizations" : {
24422442
"zh-Hans" : {
24432443
"stringUnit" : {
24442444
"state" : "translated",
2445-
"value" : "原生工具调用"
2445+
"value" : "原生函数调用"
24462446
}
24472447
}
24482448
}

Sidekick/Views/Settings/Model/ServerModelSettingsView.swift

+13-9
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ struct ServerModelSettingsView: View {
100100
.textContentType(.username)
101101
.textFieldStyle(.roundedBorder)
102102
.frame(maxWidth: 200)
103+
.onSubmit {
104+
// Run check
105+
self.checkProviderForToolCalling()
106+
}
103107
Menu {
104108
ForEach(
105109
Provider.popularProviders
@@ -131,11 +135,7 @@ struct ServerModelSettingsView: View {
131135
.padding(.top, 10)
132136
}
133137
.onChange(of: self.serverEndpoint) {
134-
// Return if invalid or blank
135-
if !self.endpointUrlIsValid || self.serverEndpoint.isEmpty {
136-
return
137-
}
138-
// Else, run check
138+
// Run check
139139
self.checkProviderForToolCalling()
140140
}
141141
}
@@ -181,10 +181,10 @@ struct ServerModelSettingsView: View {
181181
var hasNativeToolCallingToggle: some View {
182182
HStack(alignment: .top) {
183183
VStack(alignment: .leading) {
184-
Text("Native Tool Calling")
184+
Text("Native Function Calling")
185185
.font(.title3)
186186
.bold()
187-
Text("Controls whether native tool calling is available for the remote model. Turn it on only when the inference provider supports native tool calling for the selected model.")
187+
Text("Controls whether native function calling is available for the remote model. Turn it on only when the inference provider supports native tool calling for the selected model.")
188188
.font(.caption)
189189
}
190190
Spacer()
@@ -197,15 +197,19 @@ struct ServerModelSettingsView: View {
197197
}
198198

199199
private func checkProviderForToolCalling() {
200+
// Return if invalid or blank
201+
if !self.endpointUrlIsValid || self.serverEndpoint.isEmpty {
202+
return
203+
}
200204
// Check provider, defaulting to false
201205
let providerSupportsToolCalling = InferenceSettings.providerSupportsToolCalling() ?? false
202206
// If no change, exit
203207
if providerSupportsToolCalling == self.hasNativeToolCalling {
204208
return
205209
}
206210
// Get message
207-
let message: String = providerSupportsToolCalling ? String(localized: "A new endpoint has been selected, which has been identified as capable of native tool calling. Would you like to turn on native tool calling?") : String(
208-
localized: "A new endpoint has been selected, which might not be capable of native tool calling. Would you like to turn off native tool calling?"
211+
let message: String = providerSupportsToolCalling ? String(localized: "A new endpoint has been selected, which has been identified as capable of native function calling. Would you like to turn on native tool calling?") : String(
212+
localized: "A new endpoint has been selected, which might not be capable of native function calling. Would you like to turn off native tool calling?"
209213
)
210214
// Confirm with user
211215
if Dialogs.dichotomy(

0 commit comments

Comments
 (0)