diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedDefaultMutableTreeNode.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedDefaultMutableTreeNode.java index 88247e58..3165a955 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedDefaultMutableTreeNode.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedDefaultMutableTreeNode.java @@ -20,7 +20,11 @@ public class TranslatedDefaultMutableTreeNode extends DefaultMutableTreeNode if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setUserObject(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setUserObject(componentReference.value); + }); componentReference.translate(); } else diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJButton.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJButton.java index 32a60052..4072376d 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJButton.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJButton.java @@ -20,7 +20,11 @@ public class TranslatedJButton extends JButton if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setText(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setText(componentReference.value); + }); componentReference.translate(); } else diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBox.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBox.java index a602ca67..fe77f275 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBox.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBox.java @@ -38,7 +38,11 @@ public class TranslatedJCheckBox extends JCheckBox if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setText(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setText(componentReference.value); + }); componentReference.translate(); } else diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBoxMenuItem.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBoxMenuItem.java index 79e4b7e6..1bcfe33a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBoxMenuItem.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBoxMenuItem.java @@ -38,7 +38,11 @@ public class TranslatedJCheckBoxMenuItem extends JCheckBoxMenuItem if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setText(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setText(componentReference.value); + }); componentReference.translate(); } else diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJLabel.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJLabel.java index fdfedc71..6659f504 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJLabel.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJLabel.java @@ -20,7 +20,11 @@ public class TranslatedJLabel extends JLabel if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setText(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setText(componentReference.value); + }); componentReference.translate(); } else diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenu.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenu.java index 87ce255c..a802f0a6 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenu.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenu.java @@ -38,7 +38,11 @@ public class TranslatedJMenu extends JMenu if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setText(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setText(componentReference.value); + }); componentReference.translate(); } else diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenuItem.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenuItem.java index cf21277c..ef491906 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenuItem.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenuItem.java @@ -38,7 +38,11 @@ public class TranslatedJMenuItem extends JMenuItem if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setText(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setText(componentReference.value); + }); componentReference.translate(); } else diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJRadioButtonMenuItem.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJRadioButtonMenuItem.java index 1d475e0e..53453d76 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJRadioButtonMenuItem.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJRadioButtonMenuItem.java @@ -38,7 +38,11 @@ public class TranslatedJRadioButtonMenuItem extends JRadioButtonMenuItem if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setText(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setText(componentReference.value); + }); componentReference.translate(); } else diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJTextField.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJTextField.java index 8536ff5a..5690f80f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJTextField.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJTextField.java @@ -20,7 +20,11 @@ public class TranslatedJTextField extends JTextField if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setText(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setText(componentReference.value); + }); componentReference.translate(); } else diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedVisibleComponent.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedVisibleComponent.java index c7f436db..d1a87a6e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedVisibleComponent.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedVisibleComponent.java @@ -19,7 +19,11 @@ public class TranslatedVisibleComponent extends VisibleComponent if(translation != null) { componentReference = translation.getTranslatedComponentReference(); - componentReference.runOnUpdate.add(()-> setTitle(componentReference.value)); + componentReference.runOnUpdate.add(()-> + { + if(componentReference.value != null && componentReference.value.isEmpty()) + setTitle(componentReference.value); + }); componentReference.translate(); } else