Skip to content

Commit f87d0ef

Browse files
make several tooltip string translatable
1 parent 6ac3ff2 commit f87d0ef

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

enigma-swing/src/main/java/org/quiltmc/enigma/gui/panel/EntryTooltip.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.quiltmc.enigma.gui.docker.ObfuscatedClassesDocker;
2222
import org.quiltmc.enigma.gui.util.GridBagConstraintsBuilder;
2323
import org.quiltmc.enigma.gui.util.ScaleUtil;
24+
import org.quiltmc.enigma.util.I18n;
2425
import org.quiltmc.enigma.util.Utils;
2526

2627
import javax.annotation.Nullable;
@@ -230,7 +231,10 @@ public void mousePressed(MouseEvent e) {
230231
{
231232
final Box parentLabelRow = Box.createHorizontalBox();
232233

233-
final JLabel from = labelOf(inherited ? "inherited from" : "from", italEditorFont);
234+
final JLabel from = labelOf(
235+
I18n.translate(inherited ? "editor.tooltip.label.inherited_from" : "editor.tooltip.label.from"),
236+
italEditorFont
237+
);
234238
// the italics cause it to overlap with the colon if it has no right padding
235239
from.setBorder(createEmptyBorder(0, 0, 0, 1));
236240
parentLabelRow.add(from);
@@ -389,13 +393,15 @@ public void mouseClicked(MouseEvent e) {
389393
.build()
390394
);
391395

392-
mainContent.add(labelOf("No source available", italEditorFont), GridBagConstraintsBuilder.create()
393-
.pos(0, mainGridY++)
394-
.weightX(1)
395-
.fill(GridBagConstraints.HORIZONTAL)
396-
.anchor(GridBagConstraints.LINE_START)
397-
.insets(ROW_INNER_INSET, ROW_OUTER_INSET)
398-
.build()
396+
mainContent.add(
397+
labelOf(I18n.translate("editor.tooltip.message.no_source"), italEditorFont),
398+
GridBagConstraintsBuilder.create()
399+
.pos(0, mainGridY++)
400+
.weightX(1)
401+
.fill(GridBagConstraints.HORIZONTAL)
402+
.anchor(GridBagConstraints.LINE_START)
403+
.insets(ROW_INNER_INSET, ROW_OUTER_INSET)
404+
.build()
399405
);
400406
}
401407
}

enigma/src/main/resources/lang/en_us.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@
154154
"editor.quick_find.wrap": "Wrap",
155155
"editor.quick_find.not_found": "Not found!",
156156
"editor.quick_find.persistent": "Persistent",
157+
"editor.tooltip.label.from": "from",
158+
"editor.tooltip.label.inherited_from": "inherited from",
159+
"editor.tooltip.message.no_source": "No source available",
157160

158161
"info_panel.identifier": "Identifier Info",
159162
"info_panel.identifier.none": "No identifier selected",

0 commit comments

Comments
 (0)