Reputation: 2516
I have a following situation: in some of my i18n property files there are properties containing a special word:
specialword
just for example specialword
I want to have a possibility of having a property somewhere in my Config.groovy that would contain a specific value for this specialword
so that if I specify:
specialword=Value of special word
in a Config.groovy then I want my i18n properties to be resolved like:
Value of special word
just for example Value of special word
for that purpose, when building the project, I want to access property files in order to look for occurences of specialword
and to replace them with value of specialword
value from Config.groovy.
Is that possible somehow? Perhaps, someone faced similar situation? I would really appreciate any help. Thanks, Cheers
Upvotes: 0
Views: 32
Reputation: 24776
Instead of trying to change the way the properties are compiled, you would be better off passing the special value as an argument to your message code (as discussed in the comments to your question).
For instance:
<g:message code="my.key.code" args="[someVariableWithAValueFromConfig]" />
If your message code doesn't use the argument it will simply be ignored. This seems like the best approach to the problem you are trying to solve.
Upvotes: 1