sdk.paths.dialog.added.by.user.suffix=(added by user)
sdk.paths.dialog.removed.by.user.suffix=(removed by user)
+sdk.create.venv.dialog.creating.venv=Creating virtual environment
+sdk.create.venv.dialog.make.available.to.all.projects=Make available to all projects
+sdk.create.venv.dialog.select.venv.location=Select Location for Virtual Environment
+sdk.create.venv.dialog.error.not.empty.directory=Directory is not empty
+sdk.create.venv.dialog.error.empty.venv.name=VirtualEnv name can't be empty
+sdk.create.venv.dialog.error.empty.venv.location=Destination directory path can't be empty
+sdk.create.venv.dialog.error.invalid.directory.name=Invalid directory name
+sdk.create.venv.dialog.error.failed.to.create.venv=Failed to Create Virtual Environment
+
+sdk.create.venv.dialog.title=Create Virtual Environment
+sdk.create.venv.dialog.label.name=Name:
+sdk.create.venv.dialog.label.location=Location:
+sdk.create.venv.dialog.label.base.interpreter=Base interpreter:
+sdk.create.venv.dialog.label.inherit.global.site.packages=Inherit global site-packages
+sdk.create.venv.dialog.error.no.base.interpreter=Select base interpreter
+
+sdk.create.venv.conda.dialog.title=Create Conda Environment
+sdk.create.venv.conda.dialog.error.no.python.version=Select python version
+sdk.create.venv.conda.dialog.label.python.version=Python version:
+
# remote interpreters
remote.interpreter.add.title=Add Remote Interpreter
remote.interpreter.configure.title=Configure Remote Python Interpreter
import com.intellij.util.PlatformUtils;
import com.intellij.webcore.packaging.PackageManagementService;
import com.intellij.webcore.packaging.PackagesNotificationPanel;
+import com.jetbrains.python.PyBundle;
import com.jetbrains.python.packaging.PyPackageService;
import com.jetbrains.python.packaging.ui.PyPackageManagementService;
import com.jetbrains.python.sdk.flavors.VirtualEnvSdkFlavor;
myMainPanel = new JPanel(layout);
myName = new JTextField();
myDestination = new TextFieldWithBrowseButton();
- myMakeAvailableToAllProjectsCheckbox = new JBCheckBox("Make available to all projects");
+ myMakeAvailableToAllProjectsCheckbox = new JBCheckBox(PyBundle.message("sdk.create.venv.dialog.make.available.to.all.projects"));
if (project == null || project.isDefault() || !PlatformUtils.isPyCharm()) {
myMakeAvailableToAllProjectsCheckbox.setSelected(true);
myMakeAvailableToAllProjectsCheckbox.setVisible(false);
checkValid();
setInitialDestination();
addUpdater(myName);
- new LocationNameFieldsBinding(project, myDestination, myName, myInitialPath, "Select Location for Virtual Environment");
+ new LocationNameFieldsBinding(project, myDestination, myName, myInitialPath, PyBundle.message("sdk.create.venv.dialog.select.venv.location"));
}
protected void setInitialDestination() {
final String[] content = destFile.list();
if (content != null && content.length != 0) {
setOKActionEnabled(false);
- setErrorText("Directory is not empty");
+ setErrorText(PyBundle.message("sdk.create.venv.dialog.error.not.empty.directory"));
return;
}
}
if (StringUtil.isEmptyOrSpaces(projectName)) {
setOKActionEnabled(false);
- setErrorText("VirtualEnv name can't be empty");
+ setErrorText(PyBundle.message("sdk.create.venv.dialog.error.empty.venv.name"));
return;
}
if (!PathUtil.isValidFileName(projectName)) {
setOKActionEnabled(false);
- setErrorText("Invalid directory name");
+ setErrorText(PyBundle.message("sdk.create.venv.dialog.error.invalid.directory.name"));
return;
}
if (StringUtil.isEmptyOrSpaces(myDestination.getText())) {
setOKActionEnabled(false);
- setErrorText("Destination directory can't be empty");
+ setErrorText(PyBundle.message("sdk.create.venv.dialog.error.empty.venv.location"));
return;
}
public void createVirtualEnv(final VirtualEnvCallback callback) {
final ProgressManager progman = ProgressManager.getInstance();
final Sdk basicSdk = getSdk();
- final Task.Modal createTask = new Task.Modal(myProject, "Creating virtual environment", false) {
+ final Task.Modal createTask = new Task.Modal(myProject, PyBundle.message("sdk.create.venv.dialog.creating.venv"), false) {
String myPath;
public void run(@NotNull final ProgressIndicator indicator) {
try {
- indicator.setText("Creating virtual environment");
+ indicator.setText(PyBundle.message("sdk.create.venv.dialog.creating.venv"));
myPath = createEnvironment(basicSdk);
}
catch (final ExecutionException e) {
final PackageManagementService.ErrorDescription description =
PyPackageManagementService.toErrorDescription(Collections.singletonList(e), basicSdk);
if (description != null) {
- PackagesNotificationPanel.showError("Failed to Create Virtual Environment", description);
+ PackagesNotificationPanel.showError(PyBundle.message("sdk.create.venv.dialog.error.failed.to.create.venv"), description);
}
}
}, ModalityState.any());
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.CollectionComboBoxModel;
import com.intellij.ui.components.JBLabel;
+import com.jetbrains.python.PyBundle;
import com.jetbrains.python.packaging.PyCondaPackageManagerImpl;
import com.jetbrains.python.packaging.PyCondaPackageService;
import com.jetbrains.python.sdk.flavors.VirtualEnvSdkFlavor;
protected void setupDialog(Project project, final List<Sdk> allSdks) {
super.setupDialog(project, allSdks);
- setTitle("Create Conda Environment");
+ setTitle(PyBundle.message("sdk.create.venv.conda.dialog.title"));
final List<String> pythonVersions = UnsupportedFeaturesUtil.ALL_LANGUAGE_LEVELS;
Collections.reverse(pythonVersions);
mySdkCombo.setModel(new CollectionComboBoxModel<String>(pythonVersions));
c.gridx = 0;
c.gridy = 0;
c.weightx = 0.0;
- myMainPanel.add(new JBLabel("Name:"), c);
+ myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.name")), c);
c.gridx = 1;
c.gridy = 0;
c.gridy = 1;
c.gridwidth = 1;
c.weightx = 0.0;
- myMainPanel.add(new JBLabel("Location:"), c);
+ myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.location")), c);
c.gridx = 1;
c.gridy = 1;
c.gridy = 2;
c.gridwidth = 1;
c.weightx = 0.0;
- myMainPanel.add(new JBLabel("Python version:"), c);
+ myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.conda.dialog.label.python.version")), c);
c.gridx = 1;
c.gridy = 2;
super.checkValid();
if (mySdkCombo.getSelectedItem() == null) {
setOKActionEnabled(false);
- setErrorText("Select python version");
+ setErrorText(PyBundle.message("sdk.create.venv.conda.dialog.error.no.python.version"));
}
}
import com.intellij.ui.components.JBCheckBox;
import com.intellij.ui.components.JBLabel;
import com.intellij.util.NullableConsumer;
+import com.jetbrains.python.PyBundle;
import com.jetbrains.python.packaging.PyPackageManager;
import org.jetbrains.annotations.Nullable;
void setupDialog(Project project, final List<Sdk> allSdks) {
super.setupDialog(project, allSdks);
- setTitle("Create Virtual Environment");
+ setTitle(PyBundle.message("sdk.create.venv.dialog.title"));
Iterables.removeIf(allSdks, new Predicate<Sdk>() {
@Override
c.gridx = 0;
c.gridy = 0;
c.weightx = 0.0;
- myMainPanel.add(new JBLabel("Name:"), c);
+ myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.name")), c);
c.gridx = 1;
c.gridy = 0;
c.gridy = 1;
c.gridwidth = 1;
c.weightx = 0.0;
- myMainPanel.add(new JBLabel("Location:"), c);
+ myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.location")), c);
c.gridx = 1;
c.gridy = 1;
c.gridy = 2;
c.gridwidth = 1;
c.weightx = 0.0;
- myMainPanel.add(new JBLabel("Base interpreter:"), c);
+ myMainPanel.add(new JBLabel(PyBundle.message("sdk.create.venv.dialog.label.base.interpreter")), c);
c.gridx = 1;
c.gridy = 2;
c.gridy = 3;
c.gridwidth = 3;
c.insets = new Insets(2,2,2,2);
- mySitePackagesCheckBox = new JBCheckBox("Inherit global site-packages");
+ mySitePackagesCheckBox = new JBCheckBox(PyBundle.message("sdk.create.venv.dialog.label.inherit.global.site.packages"));
myMainPanel.add(mySitePackagesCheckBox, c);
c.gridx = 0;
super.checkValid();
if (mySdkCombo.getSelectedItem() == null) {
setOKActionEnabled(false);
- setErrorText("Select base interpreter");
+ setErrorText(PyBundle.message("sdk.create.venv.dialog.error.no.base.interpreter"));
}
}