We have created a base jsf project with all the common functionality and utilities that will be used as skeleton for the rest of the applications. So all new applications will import this one.
We are facing an issue with internationalization.
Parent application will have a message file containing all the strings that might be common to all projects com.parent.i18n.messages
mandatory-field=Field is mandatory
numeric-field=Field must be numeric
...
The application that will use the parent project will have its own i18 file with the messages that are specific to the application
com.child.i18n.messages
add-customer=Add customer
delete-customer=Delete customer
...
faces-config.xml of the application will include both files
<!-- Parent messages -->
<resource-bundle>
<base-name>com.parent.i18n.messages</base-name>
<var>msgbase</var>
</resource-bundle>
<!-- Application messages -->
<!-- Include base i18n for the wms-base pages -->
<resource-bundle>
<base-name>com.child.i18n.messages-base</base-name>
<var>msg</var>
</resource-bundle>
And from the view I refer these properties easily as:
<h:outputText value="#{msg['add-customer']}" />
<h:outputText value="#{msgbase['mandatory-field']}" />
What we are trying to achieve is to be able to reference the resource bundle without knowing if the message is on the parent project or in the project itself, something like:
<h:outputText value="#{allmsg['add-customer']}" />
<h:outputText value="#{allmsg['mandatory-field']}" />
Is there any way to achieve this?