Skip to content

Commit 1b2d903

Browse files
committed
localize
1 parent 795cb66 commit 1b2d903

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/client/common/utils/localize.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,3 +516,15 @@ export namespace CreateEnv {
516516
);
517517
}
518518
}
519+
520+
export namespace PythonLocator {
521+
export const startupFailedNotification = l10n.t(
522+
'Python Locator failed to start. Python environment discovery may not work correctly.',
523+
);
524+
export const windowsRuntimeMissing = l10n.t(
525+
'Missing Windows runtime dependencies detected. The Python Locator requires the Microsoft Visual C++ Redistributable. This is often missing on clean Windows installations.',
526+
);
527+
export const windowsStartupFailed = l10n.t(
528+
'Python Locator failed to start on Windows. This might be due to missing system dependencies such as the Microsoft Visual C++ Redistributable.',
529+
);
530+
}

src/client/pythonEnvironments/base/locators/common/nativePythonFinder.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type { IExtensionContext } from '../../../../common/types';
2222
import { StopWatch } from '../../../../common/utils/stopWatch';
2323
import { untildify } from '../../../../common/helpers';
2424
import { traceError } from '../../../../logging';
25-
import { Common } from '../../../../common/utils/localize';
25+
import { Common, PythonLocator } from '../../../../common/utils/localize';
2626
import { Commands } from '../../../../common/constants';
2727
import { executeCommand } from '../../../../common/vscodeApis/commandApis';
2828
import { getGlobalStorage, IPersistentStorage } from '../../../../common/persistentState';
@@ -441,21 +441,14 @@ class NativePythonFinderImpl extends DisposableBase implements NativePythonFinde
441441

442442
// Check for Windows runtime DLL issues
443443
if (isWindows() && errorMessage.toLowerCase().includes('vcruntime')) {
444-
this.outputChannel.error(
445-
'Missing Windows runtime dependencies detected. ' +
446-
'The Python Locator requires the Microsoft Visual C++ Redistributable. ' +
447-
'This is often missing on clean Windows installations.',
448-
);
444+
this.outputChannel.error(PythonLocator.windowsRuntimeMissing);
449445
} else if (isWindows()) {
450-
this.outputChannel.error(
451-
'Python Locator failed to start on Windows. ' +
452-
'This might be due to missing system dependencies such as the Microsoft Visual C++ Redistributable.',
453-
);
446+
this.outputChannel.error(PythonLocator.windowsStartupFailed);
454447
}
455448

456449
// Show notification to user
457450
const selection = await showWarningMessage(
458-
'Python Locator failed to start. Python environment discovery may not work correctly.',
451+
PythonLocator.startupFailedNotification,
459452
Common.openOutputPanel,
460453
Common.doNotShowAgain,
461454
);

0 commit comments

Comments
 (0)