I’m refactoring an existing Java desktop application to load internationalized UI text labels from a .properties file. When in the application lifecycle is the appropriate time to load the properties file and populate the strings in memory? The existing implementation defines each component’s label as e.g.: public static final String foo = "bar"; It seems inefficient to load the text in the constructor (since it’ll be shared among all instances), but doing everything in a static {...} block doesn’t seem remotely sane either. What’s the best practice here?
I’m refactoring an existing Java desktop application to load internationalized UI text labels from
Share
In most applications i’ve seen, the properties are loaded from a file before starting to construct the main UI. These properties are loaded in a ResourceBundle which will either be