diff --git a/python/pluginResources/messages/PyBundle.properties b/python/pluginResources/messages/PyBundle.properties index 7a57f4f48ce8..b3f6fc89147f 100644 --- a/python/pluginResources/messages/PyBundle.properties +++ b/python/pluginResources/messages/PyBundle.properties @@ -1656,7 +1656,8 @@ python.sdk.intention.family.name.sync.project=Sync project python.sdk.sync.project.text=Syncing project action.PipSetDefaultRequirementsAction.text=Set as the environment dependencies list -action.PipUpdateEnvAction.text=Pip Update from "requirements.txt" +action.PipUpdateEnvAction.text=Pip Update from "{0}" +action.PipUpdateEnvAction.FloatingToolbar.text=Install All action.PipEnvLockDependenciesAction.text=Generate a Pipfile.lock action.PipEnvInstallDependenciesAction.text=Install Dependencies diff --git a/python/src/com/jetbrains/python/packaging/pip/actions/PipPackageManagerAction.kt b/python/src/com/jetbrains/python/packaging/pip/actions/PipPackageManagerAction.kt index 9997b36dfffb..8231be791156 100644 --- a/python/src/com/jetbrains/python/packaging/pip/actions/PipPackageManagerAction.kt +++ b/python/src/com/jetbrains/python/packaging/pip/actions/PipPackageManagerAction.kt @@ -1,9 +1,11 @@ // Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.jetbrains.python.packaging.pip.actions +import com.intellij.openapi.actionSystem.ActionPlaces import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.PlatformDataKeys import com.intellij.openapi.vfs.VirtualFile +import com.jetbrains.python.PyBundle import com.jetbrains.python.errorProcessing.PyResult import com.jetbrains.python.packaging.management.PythonPackageManagerAction import com.jetbrains.python.packaging.management.getPythonPackageManager @@ -61,5 +63,11 @@ internal class PipUpdateEnvAction() : PipPackageManagerAction() { if (manager.sdk.isReadOnly) { e.presentation.isEnabledAndVisible = false } + if (e.place == ActionPlaces.CONTEXT_TOOLBAR) { + e.presentation.text = PyBundle.message("action.PipUpdateEnvAction.FloatingToolbar.text") + } else { + val currentFile = e.getData(PlatformDataKeys.VIRTUAL_FILE) + e.presentation.text = PyBundle.message("action.PipUpdateEnvAction.text", currentFile?.name ?: "requirements.txt") + } } } \ No newline at end of file