Skip to content

Conda "Named" environment creation silently does nothing when the display language is not English #1767

Description

Environment

Extension ms-python.vscode-python-envs 1.36.0
VS Code 1.136.1 (Windows 11, 10.0.26200)
conda 26.7.2 (miniforge3)
Display language Korean (ko)

Steps to reproduce

  1. Set the VS Code display language to any non-English locale that ships a translation bundle (e.g. ko).
  2. Run Python: Create EnvironmentConda.
  3. Pick the first option — 명명됨 (the localized "Named").
  4. Pick a Python version.

Expected

An input box appears ("Enter the name of the conda environment to create"), and after submitting a name the environment is created.

Actual

Nothing happens at all:

  • no input box,
  • no error notification,
  • not a single line written to the Python Environments output channel.

The command silently returns and no environment is created.

Cause

In the step-based conda flow, the env-type step stores the localized label into envType:

const t = await showQuickPickWithButtons([
    { label: CondaStrings.condaNamed,  description: CondaStrings.condaNamedDescription },  // l10n.t("Named")
    { label: CondaStrings.condaPrefix, description: CondaStrings.condaPrefixDescription },
], { placeHolder: CondaStrings.condaSelectEnvType, ignoreFocusOut: true, showBackButton: true });
return t ? (e.envType = t.label, p) : null;

but the following (Python-version) step dispatches on a hardcoded English literal:

return a ? (e.pythonVersion = a.description, "Named" === e.envType ? v : g) : null;

bundle.l10n.ko.json contains "Named": "명명됨", so envType === "명명됨", the comparison is false, and the flow is routed to g — the prefix location step — instead of v, the name-input step.

Steps g and m then complete without showing any UI when the workspace has exactly one project (getLocation returns the project path directly) and no existing .conda directory. So prefix gets set while envName remains undefined.

The final dispatch does compare against the localized constants, so it matches neither branch and falls through:

return a.envType === CondaStrings.condaNamed && a.envName
    ? await createNamedCondaEnvironment(t, n, r, a.envName, a.pythonVersion)
    : a.envType === CondaStrings.condaPrefix && a.prefix
    ? await createPrefixCondaEnvironment(t, n, r, a.fsPath, a.pythonVersion)
    : void 0;   // <-- silently reached

That accounts for all three symptoms: no input box (step v never runs), no log output (conda is never invoked), no error (the flow resolves to undefined).

Notes

  • Prefix still works in a localized UI by accident: step p routes to g either way, and the final dispatch's condaPrefix branch does match.
  • This affects every locale that ships a bundle, since all of them translate Named.

Suggested fix

Compare against CondaStrings.condaNamed rather than the literal "Named" — or better, keep a locale-independent discriminator (e.g. store 'named' | 'prefix' in envType) and use the localized string for display only.


Related to #1766 (a separate bug in the same conda creation flow, reproducible independently of the display language).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions