I have a Javaan MVC application in Java with GUI components in a View class. The GUI has to support two languages, so texts on buttons etc. depend on which language was set at start up. Strings are in .properties.properties files and I have a MyStrings.get(Key)MyStrings.get(Key) to get the string corresponding to Key.
Should I call MyStrings.get(Key)MyStrings.get(Key) in my View class constructor or should my Controller class pass the result of MyStrings.get(Key)MyStrings.get(Key) to the View constructor?
Option1:
Option1 - The View takes care of strings in its constructor:
View() {
button.setText(MyStrings.get("BUTTON_TEXT"));
}
Option2:
Option2 - The View gets the strings from the controler:
View(String buttonText) {
button.setText(buttonText);
}