|
16 | 16 |
|
17 | 17 | package com.jetbrains.python.impl.actions; |
18 | 18 |
|
| 19 | +import com.jetbrains.python.PythonFileType; |
| 20 | +import consulo.application.dumb.DumbAware; |
19 | 21 | import consulo.ide.action.CreateFileFromTemplateAction; |
20 | 22 | import consulo.ide.action.CreateFileFromTemplateDialog; |
21 | | -import consulo.application.dumb.DumbAware; |
| 23 | +import consulo.language.psi.PsiDirectory; |
| 24 | +import consulo.localize.LocalizeValue; |
22 | 25 | import consulo.module.extension.ModuleExtension; |
23 | 26 | import consulo.project.Project; |
24 | | -import consulo.language.psi.PsiDirectory; |
25 | | -import com.jetbrains.python.PythonFileType; |
26 | 27 | import consulo.python.module.extension.PyModuleExtension; |
| 28 | +import consulo.python.psi.icon.PythonPsiIconGroup; |
| 29 | +import jakarta.annotation.Nonnull; |
27 | 30 | import jakarta.annotation.Nullable; |
28 | 31 |
|
29 | 32 | /** |
30 | 33 | * @author yole |
31 | 34 | */ |
32 | 35 | public class CreatePythonFileAction extends CreateFileFromTemplateAction implements DumbAware { |
33 | 36 | public CreatePythonFileAction() { |
34 | | - super("Python File", "Creates a Python file from the specified template", PythonFileType.INSTANCE.getIcon()); |
| 37 | + super(LocalizeValue.localizeTODO("Python File"), LocalizeValue.localizeTODO("Creates a Python file from the specified template"), PythonPsiIconGroup.pythonfile()); |
35 | 38 | } |
36 | 39 |
|
37 | 40 | @Override |
38 | 41 | protected void buildDialog(Project project, PsiDirectory directory, CreateFileFromTemplateDialog.Builder builder) { |
39 | 42 | builder |
40 | | - .setTitle("New Python file") |
41 | | - .addKind("Python file", PythonFileType.INSTANCE.getIcon(), "Python Script") |
42 | | - .addKind("Python unit test", PythonFileType.INSTANCE.getIcon(), "Python Unit Test"); |
| 43 | + .setTitle(LocalizeValue.localizeTODO("New Python file")) |
| 44 | + .addKind(LocalizeValue.localizeTODO("Python file"), PythonFileType.INSTANCE.getIcon(), "Python Script") |
| 45 | + .addKind(LocalizeValue.localizeTODO("Python unit test"), PythonFileType.INSTANCE.getIcon(), "Python Unit Test"); |
43 | 46 | } |
44 | 47 |
|
| 48 | + @Nonnull |
45 | 49 | @Override |
46 | | - protected String getActionName(PsiDirectory directory, String newName, String templateName) { |
47 | | - return "Create Python script " + newName; |
| 50 | + protected LocalizeValue getActionName(PsiDirectory directory, String newName, String templateName) { |
| 51 | + return LocalizeValue.localizeTODO("Create Python script " + newName); |
48 | 52 | } |
49 | 53 |
|
50 | 54 | @Nullable |
|
0 commit comments