Definitions:
Files:
The presence of localization phrases stored in a physical file that is read when the application starts, and the phrases are stored in memory, which is accessed through utility methods. Phrases are stored in key format. One file per language.
Variables
Localization texts are stored as hard code variables in the application source code. Variables are complex data types and, depending on the current language, the corresponding phrase is returned.
Background:
The application is a Java servlet, and developers use Eclipse as their primary IDE.
Some short and cons:
Because Eclipse is used, tracking and finding unused locations is easier when they are stored as variables, compared to using them in a file. However, the application source code gets bigger and bloats.
What are the advantages and disadvantages of localization text in files compared to hard-coded variables in the source code? What are you doing and why?
Update 1: In my particular case, recompiling and deploying is not a problem, as it is done, because we have testing steps that enable us to find typos, etc. Because of this, we rarely have to change phrases as soon as the application runs.
source
share