22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5- import { i18nString } from '../i18n-strings.js' ;
5+ import { i18nString , UIStrings } from '../i18n-strings.js' ;
66import {
77 getMCPConfig ,
88 setMCPConfig ,
@@ -61,7 +61,7 @@ export class MCPSettings {
6161 // Title
6262 const mcpSectionTitle = document . createElement ( 'h3' ) ;
6363 mcpSectionTitle . className = 'settings-subtitle' ;
64- mcpSectionTitle . textContent = i18nString ( ' mcpSection' ) ;
64+ mcpSectionTitle . textContent = i18nString ( UIStrings . mcpSection ) ;
6565 this . container . appendChild ( mcpSectionTitle ) ;
6666 }
6767
@@ -189,12 +189,12 @@ export class MCPSettings {
189189 // Connections management
190190 const mcpConnectionsLabel = document . createElement ( 'div' ) ;
191191 mcpConnectionsLabel . className = 'settings-label' ;
192- mcpConnectionsLabel . textContent = i18nString ( ' mcpConnectionsHeader' ) ;
192+ mcpConnectionsLabel . textContent = i18nString ( UIStrings . mcpConnectionsHeader ) ;
193193 this . container . appendChild ( mcpConnectionsLabel ) ;
194194
195195 const mcpConnectionsHint = document . createElement ( 'div' ) ;
196196 mcpConnectionsHint . className = 'settings-hint' ;
197- mcpConnectionsHint . textContent = i18nString ( ' mcpConnectionsHint' ) ;
197+ mcpConnectionsHint . textContent = i18nString ( UIStrings . mcpConnectionsHint ) ;
198198 this . container . appendChild ( mcpConnectionsHint ) ;
199199
200200 const mcpConnectionsActions = document . createElement ( 'div' ) ;
@@ -206,7 +206,7 @@ export class MCPSettings {
206206
207207 const manageConnectionsButton = document . createElement ( 'button' ) ;
208208 manageConnectionsButton . className = 'settings-button' ;
209- manageConnectionsButton . textContent = i18nString ( ' mcpManageConnections' ) ;
209+ manageConnectionsButton . textContent = i18nString ( UIStrings . mcpManageConnections ) ;
210210 manageConnectionsButton . addEventListener ( 'click' , ( ) => {
211211 MCPConnectionsDialog . show ( {
212212 onSave : async ( ) => {
@@ -227,7 +227,7 @@ export class MCPSettings {
227227
228228 const refreshConnectionsButton = document . createElement ( 'button' ) ;
229229 refreshConnectionsButton . className = 'settings-button' ;
230- refreshConnectionsButton . textContent = i18nString ( ' mcpRefreshConnections' ) ;
230+ refreshConnectionsButton . textContent = i18nString ( UIStrings . mcpRefreshConnections ) ;
231231 refreshConnectionsButton . addEventListener ( 'click' , async ( ) => {
232232 try {
233233 await MCPRegistry . init ( true ) ;
@@ -254,12 +254,12 @@ export class MCPSettings {
254254 // Tool mode selection
255255 const mcpToolModeLabel = document . createElement ( 'div' ) ;
256256 mcpToolModeLabel . className = 'settings-label' ;
257- mcpToolModeLabel . textContent = i18nString ( ' mcpToolMode' ) ;
257+ mcpToolModeLabel . textContent = i18nString ( UIStrings . mcpToolMode ) ;
258258 mcpConfigContainer . appendChild ( mcpToolModeLabel ) ;
259259
260260 const mcpToolModeHint = document . createElement ( 'div' ) ;
261261 mcpToolModeHint . className = 'settings-hint' ;
262- mcpToolModeHint . textContent = i18nString ( ' mcpToolModeHint' ) ;
262+ mcpToolModeHint . textContent = i18nString ( UIStrings . mcpToolModeHint ) ;
263263 mcpConfigContainer . appendChild ( mcpToolModeHint ) ;
264264
265265 const mcpToolModeSelect = document . createElement ( 'select' ) ;
@@ -268,9 +268,9 @@ export class MCPSettings {
268268
269269 // Tool mode options
270270 const toolModeOptions = [
271- { value : 'all' , text : i18nString ( ' mcpToolModeAll' ) } ,
272- { value : 'router' , text : i18nString ( ' mcpToolModeRouter' ) } ,
273- { value : 'meta' , text : i18nString ( ' mcpToolModeMeta' ) } ,
271+ { value : 'all' , text : i18nString ( UIStrings . mcpToolModeAll ) } ,
272+ { value : 'router' , text : i18nString ( UIStrings . mcpToolModeRouter ) } ,
273+ { value : 'meta' , text : i18nString ( UIStrings . mcpToolModeMeta ) } ,
274274 ] ;
275275
276276 toolModeOptions . forEach ( option => {
@@ -295,12 +295,12 @@ export class MCPSettings {
295295 // Advanced budget controls
296296 const mcpMaxToolsLabel = document . createElement ( 'div' ) ;
297297 mcpMaxToolsLabel . className = 'settings-label' ;
298- mcpMaxToolsLabel . textContent = i18nString ( ' mcpMaxToolsPerTurn' ) ;
298+ mcpMaxToolsLabel . textContent = i18nString ( UIStrings . mcpMaxToolsPerTurn ) ;
299299 mcpConfigContainer . appendChild ( mcpMaxToolsLabel ) ;
300300
301301 const mcpMaxToolsHint = document . createElement ( 'div' ) ;
302302 mcpMaxToolsHint . className = 'settings-hint' ;
303- mcpMaxToolsHint . textContent = i18nString ( ' mcpMaxToolsPerTurnHint' ) ;
303+ mcpMaxToolsHint . textContent = i18nString ( UIStrings . mcpMaxToolsPerTurnHint ) ;
304304 mcpConfigContainer . appendChild ( mcpMaxToolsHint ) ;
305305
306306 const mcpMaxToolsInput = document . createElement ( 'input' ) ;
@@ -313,12 +313,12 @@ export class MCPSettings {
313313
314314 const mcpMaxMcpLabel = document . createElement ( 'div' ) ;
315315 mcpMaxMcpLabel . className = 'settings-label' ;
316- mcpMaxMcpLabel . textContent = i18nString ( ' mcpMaxMcpPerTurn' ) ;
316+ mcpMaxMcpLabel . textContent = i18nString ( UIStrings . mcpMaxMcpPerTurn ) ;
317317 mcpConfigContainer . appendChild ( mcpMaxMcpLabel ) ;
318318
319319 const mcpMaxMcpHint = document . createElement ( 'div' ) ;
320320 mcpMaxMcpHint . className = 'settings-hint' ;
321- mcpMaxMcpHint . textContent = i18nString ( ' mcpMaxMcpPerTurnHint' ) ;
321+ mcpMaxMcpHint . textContent = i18nString ( UIStrings . mcpMaxMcpPerTurnHint ) ;
322322 mcpConfigContainer . appendChild ( mcpMaxMcpHint ) ;
323323
324324 const mcpMaxMcpInput = document . createElement ( 'input' ) ;
@@ -468,17 +468,17 @@ export class MCPSettings {
468468 reconnectButton . className = 'settings-button' ;
469469 reconnectButton . style . padding = '2px 8px' ;
470470 reconnectButton . style . fontSize = '12px' ;
471- reconnectButton . textContent = i18nString ( ' mcpReconnectButton' ) ;
471+ reconnectButton . textContent = i18nString ( UIStrings . mcpReconnectButton ) ;
472472 reconnectButton . addEventListener ( 'click' , async ( ) => {
473473 reconnectButton . disabled = true ;
474- reconnectButton . textContent = i18nString ( ' mcpReconnectInProgress' ) ;
474+ reconnectButton . textContent = i18nString ( UIStrings . mcpReconnectInProgress ) ;
475475 try {
476476 await MCPRegistry . reconnect ( server . id ) ;
477477 clearStoredAuthError ( server . id ) ;
478478 } catch ( err ) {
479479 logger . error ( 'Failed to reconnect MCP server' , { serverId : server . id , error : err } ) ;
480480 reconnectButton . disabled = false ;
481- reconnectButton . textContent = i18nString ( ' mcpReconnectRetry' ) ;
481+ reconnectButton . textContent = i18nString ( UIStrings . mcpReconnectRetry ) ;
482482 return ;
483483 } finally {
484484 this . updateMCPStatus ( ) ;
0 commit comments