Definitions:
Files:
Having the localization phrases stored in a physical file that gets read at application start-up and the phrases are stored in the memory to be accessed via util-methods. The phrases are stored in key-value format. One file per language.
Variables:
The localization texts are stored as hard code variables in the application's source code. The variables are complex data types and depending on the current language, the appropriate phrase is returned.
Background:
The application is a Java Servlet and the developers use Eclipse as their primary IDE.
Some brief pro and cons:
Since Eclipse is use, tracking and finding unused localizations are easier when they are saved as variables, compared to having them in a file. However the application's source code becomes bigger and bloated.
What are the pro and cons of having localization text in files versus hard coded varibles in source code? What do you do and why?
Update 1: In my specific case, recompiling and deploying is not an issue, since it is done since we have test-phases that gives us a chance to find typos, etc. Because of that we rarely need to change the phrases once the application is on production.