localize "Preferences | Build, Execution, Deployment | Compiler | Java Compiler" configurable

GitOrigin-RevId: 4d15dbed97584704556261cb99a347ef26dbf796
This commit is contained in:
Dmitry.Krasilschikov
2020-01-15 21:16:33 +02:00
committed by intellij-monorepo-bot
parent df6c1a1329
commit a5e3960335
5 changed files with 31 additions and 18 deletions

View File

@@ -3,6 +3,7 @@ package com.intellij.compiler.impl.javaCompiler;
import com.intellij.compiler.options.ModuleOptionsTableModel;
import com.intellij.compiler.options.ModuleTableCellRenderer;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.project.Project;
import com.intellij.ui.InsertPathAction;
import com.intellij.ui.TableSpeedSearch;
@@ -32,14 +33,14 @@ public class CompilerModuleOptionsComponent extends JPanel {
myTable = new JBTable(new ModuleOptionsTableModel());
myTable.setRowHeight(JBUIScale.scale(22));
myTable.getEmptyText().setText("Additional compilation options will be the same for all modules");
myTable.getEmptyText().setText(CompilerBundle.message("settings.additional.compilation.options"));
TableColumn moduleColumn = myTable.getColumnModel().getColumn(0);
moduleColumn.setHeaderValue("Module");
moduleColumn.setHeaderValue(CompilerBundle.message("settings.override.module.column"));
moduleColumn.setCellRenderer(new ModuleTableCellRenderer());
TableColumn optionsColumn = myTable.getColumnModel().getColumn(1);
String columnTitle = "Compilation options";
String columnTitle = CompilerBundle.message("settings.override.compilation.options.column");
optionsColumn.setHeaderValue(columnTitle);
int width = myTable.getFontMetrics(myTable.getFont()).stringWidth(columnTitle) + 10;
optionsColumn.setPreferredWidth(width);
@@ -56,7 +57,7 @@ public class CompilerModuleOptionsComponent extends JPanel {
.setRemoveAction(b -> removeSelectedModules())
.createPanel();
table.setPreferredSize(new Dimension(myTable.getWidth(), 150));
JLabel header = new JLabel("Override compiler parameters per-module:");
JLabel header = new JLabel(CompilerBundle.message("settings.override.compiler.parameters.per.module"));
add(header, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insets(5, 5, 0, 0), 0, 0));
add(table, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, JBUI.insets(5, 5, 0, 0), 0, 0));

View File

@@ -3,7 +3,7 @@
<grid id="280f7" binding="myPanel" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="79" y="160" width="692" height="204"/>
<xy x="79" y="160" width="692" height="212"/>
</constraints>
<properties/>
<clientProperties>
@@ -64,7 +64,7 @@
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="('/' recommended in paths for cross-platform configurations)"/>
<text resource-bundle="messages/CompilerBundle" key="settings.recommended.in.paths"/>
<toolTipText value="'/' recommended in paths for cross-platform configurations"/>
</properties>
</component>

View File

@@ -3,7 +3,7 @@
<grid id="3d361" binding="myPanel" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="63" y="62" width="398" height="176"/>
<xy x="63" y="62" width="408" height="176"/>
</constraints>
<properties/>
<border type="none"/>
@@ -62,7 +62,7 @@
</constraints>
<properties>
<margin top="2" left="2" bottom="2" right="2"/>
<text value="Use '--release' option for cross-compilation (Java 9 and later)"/>
<text resource-bundle="messages/CompilerBundle" key="settings.use.release.option.for.cross.compilation"/>
</properties>
</component>
</children>

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.compiler.options;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.pom.java.LanguageLevel;
@@ -33,7 +34,6 @@ import java.util.Map;
*/
public class TargetOptionsComponent extends JPanel {
private static final String[] KNOWN_TARGETS;
private static final String COMPILER_DEFAULT = "Same as language level";
static {
List<String> targets = new ArrayList<>();
@@ -59,14 +59,14 @@ public class TargetOptionsComponent extends JPanel {
myTable = new JBTable(new ModuleOptionsTableModel());
myTable.setRowHeight(JBUIScale.scale(22));
myTable.getEmptyText().setText("All modules will be compiled with project bytecode version");
myTable.getEmptyText().setText(CompilerBundle.message("settings.all.modules.will.be.compiled.with.project.bytecode.version"));
TableColumn moduleColumn = myTable.getColumnModel().getColumn(0);
moduleColumn.setHeaderValue("Module");
moduleColumn.setHeaderValue(CompilerBundle.message("settings.module.column"));
moduleColumn.setCellRenderer(new ModuleTableCellRenderer());
TableColumn targetLevelColumn = myTable.getColumnModel().getColumn(1);
String columnTitle = "Target bytecode version";
String columnTitle = CompilerBundle.message("settings.target.bytecode.version");
targetLevelColumn.setHeaderValue(columnTitle);
targetLevelColumn.setCellEditor(new TargetLevelCellEditor());
targetLevelColumn.setCellRenderer(new TargetLevelCellRenderer());
@@ -77,9 +77,9 @@ public class TargetOptionsComponent extends JPanel {
new TableSpeedSearch(myTable);
add(new JLabel("Project bytecode version: "), constraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NONE));
add(new JLabel(CompilerBundle.message("settings.project.bytecode.version")), constraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NONE));
add(myCbProjectTargetLevel, constraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NONE));
add(new JLabel("Per-module bytecode version:"), constraints(0, 1, 2, 1, 1.0, 0.0, GridBagConstraints.NONE));
add(new JLabel(CompilerBundle.message("settings.per.module.bytecode.version")), constraints(0, 1, 2, 1, 1.0, 0.0, GridBagConstraints.NONE));
JPanel tableComp = ToolbarDecorator.createDecorator(myTable)
.disableUpAction()
.disableDownAction()
@@ -96,8 +96,8 @@ public class TargetOptionsComponent extends JPanel {
combo.setEditor(new BasicComboBoxEditor() {
@Override
protected JTextField createEditorComponent() {
JBTextField editor = new JBTextField(COMPILER_DEFAULT, 12);
editor.getEmptyText().setText(COMPILER_DEFAULT);
JBTextField editor = new JBTextField(CompilerBundle.message("settings.same.as.language.level"), 12);
editor.getEmptyText().setText(CompilerBundle.message("settings.same.as.language.level"));
editor.setBorder(null);
return editor;
}
@@ -158,7 +158,7 @@ public class TargetOptionsComponent extends JPanel {
comp.setHorizontalAlignment(SwingConstants.CENTER);
if ("".equals(value)) {
comp.setForeground(JBColor.GRAY);
comp.setText(COMPILER_DEFAULT);
comp.setText(CompilerBundle.message("settings.same.as.language.level"));
}
else {
comp.setForeground(table.getForeground());

View File

@@ -161,3 +161,15 @@ settings.user.local.build.process.vm.options=User-local build process VM options
settings.auto.build.only.works.while.not.running=(only works while not running / debugging)
settings.parallel.module.compile.may.require.larger.heap.size=(may require larger heap size)
settings.warning=<html>WARNING!<br>If option 'Clear output directory on rebuild' is enabled, the entire contents of directories where generated sources are stored WILL BE CLEARED on rebuild.</html>
settings.use.release.option.for.cross.compilation=Use '--release' option for cross-compilation (Java 9 and later)
settings.project.bytecode.version=Project bytecode version:
settings.per.module.bytecode.version=Per-module bytecode version:
settings.same.as.language.level=Same as language level
settings.all.modules.will.be.compiled.with.project.bytecode.version=All modules will be compiled with project bytecode version
settings.module.column=Module
settings.target.bytecode.version=Target bytecode version
settings.recommended.in.paths=('/' recommended in paths for cross-platform configurations)
settings.override.compiler.parameters.per.module=Override compiler parameters per-module:
settings.override.module.column=Module
settings.override.compilation.options.column=Compilation options
settings.additional.compilation.options=Additional compilation options will be the same for all modules