[i18n] give meaningful prefixes to new properties in CodeInsightBundle

This makes it easier to translate them and also simplifies searching for usages (it's hard to find usages of property with name 'remove').

GitOrigin-RevId: 87bce4ecec0ecd00e29cf789b5a4069a7a2a3e32
This commit is contained in:
nik
2020-02-17 08:13:34 +00:00
committed by intellij-monorepo-bot
parent 5d8355dd05
commit aa5940670f
31 changed files with 91 additions and 89 deletions
@@ -770,7 +770,7 @@ public class AnnotationsHighlightUtil {
@NotNull
@Override
public String getText() {
return CodeInsightBundle.message("remove");
return CodeInsightBundle.message("intention.text.remove.annotation");
}
@NotNull
@@ -37,7 +37,7 @@ public class MakeAnnotationExternal extends BaseIntentionAction {
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("annotate.externally");
return CodeInsightBundle.message("intention.text.annotate.externally");
}
@Override
@@ -51,7 +51,7 @@ public class MakeAnnotationExternal extends BaseIntentionAction {
VirtualFile virtualFile = PsiUtilCore.getVirtualFile(modifierListOwner);
if (JavaCodeStyleSettings.getInstance(file).USE_EXTERNAL_ANNOTATIONS ||
virtualFile != null && ExternalAnnotationsManager.getInstance(project).hasAnnotationRootsForFile(virtualFile)) {
setText(CodeInsightBundle.message("annotate.externally"));
setText(CodeInsightBundle.message("intention.text.annotate.externally"));
return true;
}
}
@@ -45,7 +45,7 @@ public class MakeExternalAnnotationExplicit extends BaseIntentionAction {
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("make.external.annotations.explicit");
return CodeInsightBundle.message("intention.family.make.external.annotations.explicit");
}
@Override
@@ -62,7 +62,7 @@ public class MakeExternalAnnotationExplicit extends BaseIntentionAction {
final String name = nameRef != null ? nameRef.getReferenceName() : annotation.getQualifiedName();
return "@" + name + annotation.getParameterList().getText();
}, " ");
setText(CodeInsightBundle.message("insert.0", annos));
setText(CodeInsightBundle.message("intention.text.insert.0.annotation", annos));
return true;
}
}
@@ -47,7 +47,7 @@ public class MakeInferredAnnotationExplicit extends BaseIntentionAction {
@Nls
@Override
public @NotNull String getFamilyName() {
return CodeInsightBundle.message("make.inferred.annotations.explicit");
return CodeInsightBundle.message("intention.family.make.inferred.annotations.explicit");
}
@Override
@@ -67,7 +67,7 @@ public class MakeInferredAnnotationExplicit extends BaseIntentionAction {
.map(MakeInferredAnnotationExplicit::getAnnotationPresentation)
.joining(" ");
if (!annotations.isEmpty()) {
setText(CodeInsightBundle.message("insert.0", annotations));
setText(CodeInsightBundle.message("intention.text.insert.0.annotation", annotations));
return true;
}
}
@@ -186,7 +186,7 @@ public abstract class NonCodeAnnotationsLineMarkerProvider extends LineMarkerPro
for (PsiParameter parameter: method.getParameterList().getParameters()) {
MakeInferredAnnotationExplicit intention = new MakeInferredAnnotationExplicit();
if (intention.isAvailable(project, file, parameter)) {
actions.add(new AnAction(CodeInsightBundle.message("0.on.parameter.1", intention.getText(), parameter.getName())) {
actions.add(new AnAction(CodeInsightBundle.message("action.text.0.on.parameter.1", intention.getText(), parameter.getName())) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
PsiDocumentManager.getInstance(project).commitAllDocuments();
@@ -251,7 +251,7 @@ public class MarkerType {
private static void navigateToOverriddenMethod(MouseEvent e, @NotNull final PsiMethod method) {
if (DumbService.isDumb(method.getProject())) {
DumbService.getInstance(method.getProject()).showDumbModeNotification(
CodeInsightBundle.message("navigation.to.overriding.classes"));
CodeInsightBundle.message("notification.navigation.to.overriding.classes"));
return;
}
@@ -330,7 +330,7 @@ public class MarkerType {
PsiElementListCellRenderer<NavigatablePsiElement> renderer) {
if (DumbService.isDumb(aClass.getProject())) {
DumbService.getInstance(aClass.getProject()).showDumbModeNotification(
CodeInsightBundle.message("navigation.to.overriding.methods"));
CodeInsightBundle.message("notification.navigation.to.overriding.methods"));
return;
}
@@ -82,7 +82,7 @@ public class RecursiveCallLineMarkerProvider extends LineMarkerProviderDescripto
@NotNull
@Override
public String getName() {
return CodeInsightBundle.message("recursive.call");
return CodeInsightBundle.message("line.marker.recursive.call");
}
@Nullable
@@ -169,9 +169,9 @@ public class CreateServiceImplementationClassFix extends CreateServiceClassFixBa
super(project);
setTitle(QuickFixBundle.message("create.service.implementation"));
mySubclassButton.setText(CodeInsightBundle.message("subclass.of.0", superClassName));
mySubclassButton.setText(CodeInsightBundle.message("radio.button.subclass.of.0", superClassName));
mySubclassButton.setSelected(true);
myProviderButton.setText(CodeInsightBundle.message("with.provider.method"));
myProviderButton.setText(CodeInsightBundle.message("radio.button.with.provider.method"));
ButtonGroup group = new ButtonGroup();
group.add(mySubclassButton);
@@ -197,7 +197,7 @@ public class CreateServiceImplementationClassFix extends CreateServiceClassFixBa
@Override
protected JComponent createNorthPanel() {
PanelGridBuilder builder = UI.PanelFactory.grid();
builder.add(UI.PanelFactory.panel(mySubclassButton).withLabel(CodeInsightBundle.message("implementation")))
builder.add(UI.PanelFactory.panel(mySubclassButton).withLabel(CodeInsightBundle.message("label.implementation")))
.add(UI.PanelFactory.panel(myProviderButton));
if (myRootDirCombo.getModel().getSize() > 1) {
builder.add(UI.PanelFactory.panel(myRootDirCombo).withLabel(CommonBundle.message("label.source.root") + ":"));
@@ -85,7 +85,7 @@ public class MoveClassToModuleFix implements IntentionAction {
@Override
@NotNull
public String getFamilyName() {
return CodeInsightBundle.message("move.it");
return CodeInsightBundle.message("intention.family.move.it");
}
@Override
@@ -48,7 +48,7 @@ public class VariableAccessFromInnerClassJava10Fix extends BaseIntentionAction {
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("variable.access.from.inner.class");
return CodeInsightBundle.message("intention.family.variable.access.from.inner.class");
}
@Override
@@ -138,7 +138,7 @@ public class JavaTypedHandler extends TypedHandlerDelegate {
if (CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET && isRparenth(leaf) &&
(st instanceof PsiWhileStatement || st instanceof PsiIfStatement) && shouldInsertStatementBody(st, doc, prev)) {
CommandProcessor.getInstance().executeCommand(project, () -> new JavaSmartEnterProcessor().process(project, editor, file),
CodeInsightBundle.message("insert.block.statement"), null);
CodeInsightBundle.message("command.name.insert.block.statement"), null);
return Result.STOP;
}
@@ -229,7 +229,8 @@ public class JavaOverrideImplementMemberChooser extends MemberChooser<PsiMethodM
private class MyMergeAction extends ToggleAction {
private MyMergeAction() {
super(CodeInsightBundle.message("show.methods.to.implement"), CodeInsightBundle.message("show.methods.to.implement"), AllIcons.General.Show_to_implement);
super(CodeInsightBundle.message("action.text.show.methods.to.implement"), CodeInsightBundle.message(
"action.text.show.methods.to.implement"), AllIcons.General.Show_to_implement);
registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.ALT_MASK)), myTree);
registerCustomShortcutSet(getActiveKeymapShortcuts("OverrideMethods"), myTree);
}
@@ -55,7 +55,7 @@ public class JavaTypeProvider extends ExpressionTypeProvider<PsiExpression> {
@NotNull
@Override
public String getErrorHint() {
return CodeInsightBundle.message("no.expression.found");
return CodeInsightBundle.message("error.hint.no.expression.found");
}
@NotNull
@@ -50,7 +50,7 @@ public class AddJavadocIntention extends BaseElementAtCaretIntentionAction imple
@Override
public String getFamilyName() {
//noinspection DialogTitleCapitalization
return CodeInsightBundle.message("add.javadoc");
return CodeInsightBundle.message("intention.family.add.javadoc");
}
@NotNull
@@ -209,7 +209,7 @@ public class BindFieldsFromParametersAction extends BaseIntentionAction implemen
ParameterClassMember @NotNull [] members) {
final MemberChooser<ParameterClassMember> chooser = new MemberChooser<>(members, false, true, project);
chooser.selectElements(getInitialSelection(method, members));
chooser.setTitle(CodeInsightBundle.message("choose.0.parameters", method.isConstructor() ? "Constructor" : "Method"));
chooser.setTitle(CodeInsightBundle.message("dialog.title.choose.0.parameters", method.isConstructor() ? "Constructor" : "Method"));
chooser.show();
return chooser;
}
@@ -27,7 +27,7 @@ public class CollapseAnnotationsFix extends LocalQuickFixAndIntentionActionOnPsi
@NotNull
@Override
public String getText() {
return CodeInsightBundle.message("collapse.repeating.annotations");
return CodeInsightBundle.message("intention.text.collapse.repeating.annotations");
}
@Override
@@ -63,7 +63,7 @@ public class ConvertAbsolutePathToRelativeIntentionAction extends BaseIntentionA
@NotNull
public String getFamilyName() {
return CodeInsightBundle
.message("convert.0.path.to.1", isConvertToRelative() ? "absolute" : "relative", isConvertToRelative() ? "relative" : "absolute");
.message("intention.family.convert.0.path.to.1", isConvertToRelative() ? "absolute" : "relative", isConvertToRelative() ? "relative" : "absolute");
}
@Override
@@ -79,6 +79,6 @@ public class ConvertAbsolutePathToRelativeIntentionAction extends BaseIntentionA
@NotNull
@Override
public String getText() {
return CodeInsightBundle.message("convert.path.to.0", isConvertToRelative() ? "relative" : "absolute");
return CodeInsightBundle.message("intention.text.convert.path.to.0", isConvertToRelative() ? "relative" : "absolute");
}
}
@@ -28,7 +28,7 @@ public class CopyAbstractMethodImplementationAction extends ImplementAbstractMet
@Override
@NotNull
public String getFamilyName() {
return CodeInsightBundle.message("copy.abstract.method.implementation");
return CodeInsightBundle.message("intention.family.copy.abstract.method.implementation");
}
@Override
@@ -59,14 +59,14 @@ public class CreateClassInPackageInModuleFix implements IntentionAction {
@NotNull
@Override
public String getText() {
return CodeInsightBundle.message("create.a.class.in.0", myPackageName);
return CodeInsightBundle.message("intention.text.create.a.class.in.0", myPackageName);
}
@Nls
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("create.a.class.in.package");
return CodeInsightBundle.message("intention.family.create.a.class.in.package");
}
@Override
@@ -142,7 +142,7 @@ public class CreateClassInPackageInModuleFix implements IntentionAction {
CreateClassInPackageDialog(@Nullable Project project, PsiDirectory @NotNull [] rootDirs) {
super(project);
myProject = project;
setTitle(CodeInsightBundle.message("create.class.in.package"));
setTitle(CodeInsightBundle.message("dialog.title.create.class.in.package"));
myRootDirCombo.setRenderer(new CreateServiceClassFixBase.PsiDirectoryListCellRenderer());
myRootDirCombo.setModel(new DefaultComboBoxModel<>(rootDirs));
@@ -176,7 +176,7 @@ public class CreateClassInPackageInModuleFix implements IntentionAction {
PanelGridBuilder builder = UI.PanelFactory.grid();
builder.add(UI.PanelFactory.panel(myNameTextField)
.withLabel(CommonBundle.message("label.name") + ":")
.withComment(CodeInsightBundle.message("the.class.will.be.created.in.the.package.0", myPackageName)));
.withComment(CodeInsightBundle.message("comment.the.class.will.be.created.in.the.package.0", myPackageName)));
if (myRootDirCombo.getModel().getSize() > 1) {
builder.add(UI.PanelFactory.panel(myRootDirCombo).withLabel(CommonBundle.message("label.source.root") + ":"));
}
@@ -194,7 +194,7 @@ public class CreateClassInPackageInModuleFix implements IntentionAction {
if (PsiNameHelper.getInstance(myProject).isIdentifier(name, level)) {
return null;
}
return new ValidationInfo(CodeInsightBundle.message("this.is.not.a.valid.java.class.name"), myNameTextField);
return new ValidationInfo(CodeInsightBundle.message("error.text.this.is.not.a.valid.java.class.name"), myNameTextField);
}
@NotNull
@@ -40,7 +40,7 @@ public class ExpandStaticImportAction extends BaseElementAtCaretIntentionAction
@Override
@NotNull
public String getFamilyName() {
return CodeInsightBundle.message("expand.static.import");
return CodeInsightBundle.message("intention.family.expand.static.import");
}
@Override
@@ -55,7 +55,7 @@ public class ExpandStaticImportAction extends BaseElementAtCaretIntentionAction
if (resolveScope instanceof PsiImportStaticStatement) {
final PsiClass targetClass = ((PsiImportStaticStatement)resolveScope).resolveTargetClass();
if (targetClass == null) return false;
setText(CodeInsightBundle.message("replace.static.import.with.qualified.access.to.0", targetClass.getName()));
setText(CodeInsightBundle.message("intention.text.replace.static.import.with.qualified.access.to.0", targetClass.getName()));
return true;
}
return false;
@@ -130,7 +130,8 @@ public class ExtractSetFromComparisonChainAction extends PsiElementBaseIntention
Messages.showYesNoDialog(project,
CodeInsightBundle.message("intention.extract.set.from.comparison.chain.duplicates",
ApplicationNamesInfo.getInstance().getProductName(),
copies.size()), CodeInsightBundle.message("process.duplicates"),
copies.size()), CodeInsightBundle.message(
"dialog.title.process.duplicates"),
Messages.getQuestionIcon());
if (answer == Messages.YES) {
WriteAction.run(() -> {
@@ -86,14 +86,14 @@ public class SameErasureButDifferentMethodsFix extends LocalQuickFixAndIntention
public String getText() {
PsiMethod method = methodPtr.getElement();
if (method == null || !method.isValid()) return getFamilyName();
return CodeInsightBundle.message("fix.method.0.parameters.with.bounded.wildcards", method.getName());
return CodeInsightBundle.message("intention.text.fix.method.0.parameters.with.bounded.wildcards", method.getName());
}
@Nls
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("fix.bounded.wildcards");
return CodeInsightBundle.message("intention.family.fix.bounded.wildcards");
}
@Override
@@ -50,7 +50,7 @@ public class SortContentAction extends PsiElementBaseIntentionAction {
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("sort.content");
return CodeInsightBundle.message("intention.family.sort.content");
}
@NotNull
@@ -70,7 +70,7 @@ public class SwapIfStatementsIntentionAction extends PsiElementBaseIntentionActi
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("swap.if.statements");
return CodeInsightBundle.message("intention.family.swap.if.statements");
}
@NotNull
@@ -42,7 +42,7 @@ public class JavaChopArgumentsAction extends AbstractJavaChopListAction<PsiExpre
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("put.arguments.on.separate.lines");
return CodeInsightBundle.message("intention.family.put.arguments.on.separate.lines");
}
@NotNull
@@ -41,7 +41,7 @@ public class JavaChopParametersAction extends AbstractJavaChopListAction<PsiPara
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("put.parameters.on.separate.lines");
return CodeInsightBundle.message("intention.family.put.parameters.on.separate.lines");
}
@NotNull
@@ -41,7 +41,7 @@ public class JavaJoinArgumentsAction extends AbstractJavaJoinListAction<PsiExpre
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("put.arguments.on.one.line");
return CodeInsightBundle.message("intention.family.put.arguments.on.one.line");
}
@NotNull
@@ -42,7 +42,7 @@ public class JavaJoinParametersAction extends AbstractJavaJoinListAction<PsiPara
@NotNull
@Override
public String getFamilyName() {
return CodeInsightBundle.message("put.parameters.on.one.line");
return CodeInsightBundle.message("intention.family.put.parameters.on.one.line");
}
@NotNull
@@ -113,8 +113,8 @@ public class JavaPostfixTemplateEditor extends PostfixTemplateEditorBase<JavaPos
private final Project myProject;
protected ChooseClassAction(@Nullable Project project) {
super((project != null && !project.isDefault() ? CodeInsightBundle.message("choose.class.in.0", project.getName())
: CodeInsightBundle.message("enter.class.name")));
super((project != null && !project.isDefault() ? CodeInsightBundle.message("action.text.choose.class.in.0", project.getName())
: CodeInsightBundle.message("action.text.enter.class.name")));
myProject = project;
}
@@ -129,8 +129,8 @@ public class JavaPostfixTemplateEditor extends PostfixTemplateEditorBase<JavaPos
private String getFqn() {
String title = "Choose Class";
if (myProject == null || myProject.isDefault()) {
return Messages.showInputDialog(myPanel, CodeInsightBundle.message("enter.fully.qualified.class.name"),
CodeInsightBundle.message("choose.class"), null);
return Messages.showInputDialog(myPanel, CodeInsightBundle.message("label.enter.fully.qualified.class.name"),
CodeInsightBundle.message("dialog.title.choose.class"), null);
}
TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject).createAllProjectScopeChooser(title);
chooser.showDialog();
@@ -95,7 +95,7 @@ public class ExternalAnnotationsTest extends UsefulTestCase {
public void testFromSrcToExternal() {
myFixture.configureByFiles("src/fromSrc/Foo.java", "content/anno/fromSrc/annotations.xml");
IntentionAction action = myFixture.findSingleIntention(CodeInsightBundle.message("annotate.externally"));
IntentionAction action = myFixture.findSingleIntention(CodeInsightBundle.message("intention.text.annotate.externally"));
assertNotNull(action);
myFixture.launchAction(action);
@@ -680,53 +680,53 @@ action.presentation.DocumentationComponent.text=Edit Source
action.presentation.LookupUi.text=action.presentation.LookupUi.text
action.presentation.QuickFixPreviewPanelFactory.text=Fix partially
action.presentation.QuickFixPreviewPanelFactory.text.suppress=Suppress
remove=Remove
process.duplicates=Process Duplicates
swap.if.statements=Swap 'if' statements
replace.static.import.with.qualified.access.to.0=Replace static import with qualified access to {0}
expand.static.import=Expand static import
0.on.parameter.1={0} on parameter ''{1}''
recursive.call=Recursive call
fix.bounded.wildcards=Fix bounded wildcards
fix.method.0.parameters.with.bounded.wildcards=Fix method ''{0}'' parameters with bounded wildcards
variable.access.from.inner.class=Variable accessFromInnerClass
put.arguments.on.separate.lines=Put arguments on separate lines
annotate.externally=Annotate Externally
put.parameters.on.one.line=Put parameters on one line
intention.text.remove.annotation=Remove
dialog.title.process.duplicates=Process Duplicates
intention.family.swap.if.statements=Swap 'if' statements
intention.text.replace.static.import.with.qualified.access.to.0=Replace static import with qualified access to {0}
intention.family.expand.static.import=Expand static import
action.text.0.on.parameter.1={0} on parameter ''{1}''
line.marker.recursive.call=Recursive call
intention.family.fix.bounded.wildcards=Fix bounded wildcards
intention.text.fix.method.0.parameters.with.bounded.wildcards=Fix method ''{0}'' parameters with bounded wildcards
intention.family.variable.access.from.inner.class=Variable accessFromInnerClass
intention.family.put.arguments.on.separate.lines=Put arguments on separate lines
intention.text.annotate.externally=Annotate Externally
intention.family.put.parameters.on.one.line=Put parameters on one line
please.report.a.bug=Please report a bug
put.parameters.on.separate.lines=Put parameters on separate lines
choose.class=Choose Class
enter.fully.qualified.class.name=Enter fully qualified class name
enter.class.name=enter class name...
choose.class.in.0=choose class in {0}...
insert.block.statement=Insert block statement
this.is.not.a.valid.java.class.name=This is not a valid Java class name
the.class.will.be.created.in.the.package.0=The class will be created in the package ''{0}''
create.class.in.package=Create Class in Package
create.a.class.in.package=Create a class in package
create.a.class.in.0=Create a class in ''{0}''
insert.0=Insert ''{0}''
make.inferred.annotations.explicit=Make Inferred Annotations Explicit
put.arguments.on.one.line=Put arguments on one line
make.external.annotations.explicit=Make External Annotations Explicit
show.methods.to.implement=Show methods to implement
intention.family.put.parameters.on.separate.lines=Put parameters on separate lines
dialog.title.choose.class=Choose Class
label.enter.fully.qualified.class.name=Enter fully qualified class name
action.text.enter.class.name=enter class name...
action.text.choose.class.in.0=choose class in {0}...
command.name.insert.block.statement=Insert block statement
error.text.this.is.not.a.valid.java.class.name=This is not a valid Java class name
comment.the.class.will.be.created.in.the.package.0=The class will be created in the package ''{0}''
dialog.title.create.class.in.package=Create Class in Package
intention.family.create.a.class.in.package=Create a class in package
intention.text.create.a.class.in.0=Create a class in ''{0}''
intention.text.insert.0.annotation=Insert ''{0}''
intention.family.make.inferred.annotations.explicit=Make Inferred Annotations Explicit
intention.family.put.arguments.on.one.line=Put arguments on one line
intention.family.make.external.annotations.explicit=Make External Annotations Explicit
action.text.show.methods.to.implement=Show methods to implement
convert.compareto.expression.to.equals.call.may.change.semantics=Convert 'compareTo()' expression to 'equals()' call (may change semantics)
convert.compareto.expression.to.equals.call=Convert 'compareTo()' expression to 'equals()' call
java.line.markers=Java line markers
add.javadoc=Add Javadoc
copy.abstract.method.implementation=Copy abstract method implementation
implementation=Implementation:
with.provider.method=With 'provider()' method
subclass.of.0=Subclass of ''{0}''
no.expression.found=No expression found
navigation.to.overriding.methods=Navigation to overriding methods is not possible during index update
navigation.to.overriding.classes=Navigation to overriding classes is not possible during index update
sort.content=Sort content
collapse.repeating.annotations=Collapse repeating annotations
convert.path.to.0=Convert path to {0}
convert.0.path.to.1=Convert {0} path to {1}
move.it=move it
choose.0.parameters=Choose {0} Parameters
intention.family.add.javadoc=Add Javadoc
intention.family.copy.abstract.method.implementation=Copy abstract method implementation
label.implementation=Implementation:
radio.button.with.provider.method=With 'provider()' method
radio.button.subclass.of.0=Subclass of ''{0}''
error.hint.no.expression.found=No expression found
notification.navigation.to.overriding.methods=Navigation to overriding methods is not possible during index update
notification.navigation.to.overriding.classes=Navigation to overriding classes is not possible during index update
intention.family.sort.content=Sort content
intention.text.collapse.repeating.annotations=Collapse repeating annotations
intention.text.convert.path.to.0=Convert path to {0}
intention.family.convert.0.path.to.1=Convert {0} path to {1}
intention.family.move.it=Move it
dialog.title.choose.0.parameters=Choose {0} Parameters
generate.hashcode.template.title=HashCode Template:
generate.equals.template.title=Equals Template:
postfix.template.language.level.title=Minimum language level: