Hi,
for some weird feeling of intuition I tried to do the following:
JSP:
Code:
<t:row id="g_13" >
<t:label id="g_14" text="Static I18N Test" width="150" />
<t:label id="g_15" text="#{rr.literals['literals.usage.static']}" />
</t:row>
<t:row id="g_16" >
<t:label id="g_17" text="Dynamically used literal" width="150" />
<t:label id="g_18" text="#{d.HelloWorldUI.resourceLiteralExpression}" />
</t:row>
Java Ui class:
Code:
public String getResourceLiteralExpression() {
return "#{rr.literals['literals.usage.dynamic']}";
}
Properties-File:
Code:
literals.usage.dynamic=Dynamically used literal
literals.usage.static=Statically used literal
This (the second way to internationalize) does not work since the expression is resolved once, but for my "expression in expression" scenario it would need to be resolved twice (first the property in the UI class and with the result of this the literal of the properties file).
Björn, could you imagine that it could be possible to resolve expressions iteratively until it's no expression any more.
The reason why I find it desirable to do this is the fact that, as long as you use unparameterized literals, UI classes would only need to know about the message keys and could be language- and message-source-agnostic. I hope this does not seem too weird of an idea to you.
Regards,
Björn