cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with I18N message in a jar file

agey
Champ in-the-making
Champ in-the-making
Hi all,

I am creating an extension project of Share. I found an example extension project to create a jar file and attach it to Share. The project consists of an action link to the document menu. It displays a form to enter data for action. I use a custom.properties file to define text labels and place it into config/alfresco/messages but the labels aren't showed.

The custom.properties file in jar project is in ext-share.jar#alfresco\messages. Is there any configuration to detect that messages file? I tried to put this into custom-slingshot-application-context.xml but doesn't work:

<bean id="custom.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
      <property name="resourceBundles">
         <list>
            <value>alfresco.messages.custom</value>
         </list>
      </property>
</bean>


Thanks a lot in advance,
2 REPLIES 2

shazada
Star Contributor
Star Contributor
Hi You need to override the default bean webscripts.resources which is defined in slingshot-application-context.xml

So in your case it would be.


<!– Add in the custom Messages –>
   <!– Override WebScript Messages - add slingshot application messages –>
   <bean id="webscripts.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
      <property name="resourceBundles">
         <list>
            <value>webscripts.messages.webscripts</value>
            <value>alfresco.messages.common</value>
            <value>alfresco.messages.slingshot</value>
            <value>alfresco.messages.custom</value>
         </list>
      </property>
   </bean>

agey
Champ in-the-making
Champ in-the-making
Thank you. Your solution works fine.