If I have a fixed String
within a method can it be altered using reflection or something like that?
Example:
public static void main(String[] args) {
String nome = getName();
boolean valid = isValidName(nome);
if (valid) {
System.out.print("Seu nome é valido!");
} else {
System.out.println("Seu nome é inválido!");
}
}
I would need to change the message "Your name is invalid!" to "Invalid Name." this at runtime, ie after compiling and running the program I would need to edit this message.
I'm working with an API that is in English, the client has asked me to translate it 100%. The API has configurable messages, where you can simply go to the lang.txt file and change the messages, however there are some messages that are not available in this lang.txt file so I had to edit them using reflection, but I came across some messages which are "fixed" (I do not know if this is the correct term) and I would need to edit these messages ... these messages follow the example above.