Internationalization template strings
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2006 05:24 AM
hi,
how i can make a freemarker template multilingual ?
Im using template for dashlet and i want to internationalize it how i can do it ?
i had trieed this :
how i can make a freemarker template multilingual ?
Im using template for dashlet and i want to internationalize it how i can do it ?
i had trieed this :
${message(product_name)}
for instance but its not working.
Labels:
- Labels:
-
Archive
14 REPLIES 14
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2006 05:13 AM
Merci ribz for the time you spend answering my question.
I've tried that but still does not work.
Actually I want to add a custom action in the "More Actions" menu so in the web-client-config-custom.xml I have added the following:
<config>
<actions>
<action id="my_details_space">
<label-id>generate_odj</label-id>
<image>/images/icons/View_details.gif</image>
<action-listener>#{BrowseBean.setupSpaceAction}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<action-group id="browse_actions_menu">
<action idref="my_details_space" />
</action-group>
</actions>
</config>
But the label appears as follow on the UI:
$$generate_odj$$
I've tried that but still does not work.
Actually I want to add a custom action in the "More Actions" menu so in the web-client-config-custom.xml I have added the following:
<config>
<actions>
<action id="my_details_space">
<label-id>generate_odj</label-id>
<image>/images/icons/View_details.gif</image>
<action-listener>#{BrowseBean.setupSpaceAction}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<action-group id="browse_actions_menu">
<action idref="my_details_space" />
</action-group>
</actions>
</config>
But the label appears as follow on the UI:
$$generate_odj$$
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2006 05:32 AM
Ok that is different !
In your case you try to internationalize webclient and not core or special jsp.
In this case i don't know how we can define well string in an extension ressource bundle.
For webclient, me i code label directly in webclient.properties
I'm sorry i don't know how we can do it like extension.
You need help of alfresco engineers now to do that like you want.
And be careful if you add webclient.properties and webclient.properties_en_US i dont know why but for me alfresco don't overwrite well it. So i write it directly in WAR.
I know its not best way but its the only that i had found at the moment which is working
ops:
In your case you try to internationalize webclient and not core or special jsp.
In this case i don't know how we can define well string in an extension ressource bundle.
For webclient, me i code label directly in webclient.properties
I'm sorry i don't know how we can do it like extension.
You need help of alfresco engineers now to do that like you want.
And be careful if you add webclient.properties and webclient.properties_en_US i dont know why but for me alfresco don't overwrite well it. So i write it directly in WAR.
I know its not best way but its the only that i had found at the moment which is working


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2007 04:12 PM
Hi,
To add a custom label in this way requires a "webclient.properties" to be placed in the alfresco.extension package.
If you are using JBoss this file should go in the directory mentioned by ribz33 i.e. in C:\alfresco\jboss\server\default\conf\alfresco\extension
The following wiki page explains the process: http://wiki.alfresco.com/wiki/Adding_Custom_I18N_Strings
To add a custom label in this way requires a "webclient.properties" to be placed in the alfresco.extension package.
If you are using JBoss this file should go in the directory mentioned by ribz33 i.e. in C:\alfresco\jboss\server\default\conf\alfresco\extension
The following wiki page explains the process: http://wiki.alfresco.com/wiki/Adding_Custom_I18N_Strings
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2008 10:44 AM
after setting the values in webclient.properties file, are they available on the freemarker templates as well ??
${message("product_name")}
${message("product_name")}

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2008 11:17 AM
Hi guys,
It IS possible (at least in Alfresco Labs 3C) to create differente message properties files, not using default webclient.properties.
And so making it easier to develop in larger teams and not interfere with translations.
After digging into the source code, I found out how:
You basically have 2 different beans dealing with messages:
1) the default Alfresco one:
This one uses:
org.alfresco.i18n.ResourceBundleBootstrapComponent
as defined and configured inside:
WEB-INF/classes/alfresco/core-services-context.xml
2) And the Webclient one:
org.alfresco.web.app.ResourceBundleBootstrap
(check out the src code of org.alfresco.web.app.ResourceBundleWrapper to find out more about it)
Webclient resources are loaded by this class, but it not defined yet in a normal Alfresco environment.
Instead, you have to define yourself.
So, if you want to use different webclient message files, you need to add them to the list.
So, create a file :
WEB-INF/classes/alfresco/extension/custom-webclient-context.xml
contents:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="resourceBundlesWebApp" class="org.alfresco.web.app.ResourceBundleBootstrap">
<property name="resourceBundles">
<list>
<value>alfresco.extension.custom-webclient</value>
</list>
</property>
</bean>
</beans>
And then put you're properties into:
WEB-INF/classes/alfresco/extension/custom-webclient.properties
Now you're action labels etc will work !
For inside the JSP, you off course still have to load them like this
<f:loadBundle basename="alfresco.extension.custom-webclient" var="customMsg"/>
hope this helped!
Kind regards
Dominique De Munck
It IS possible (at least in Alfresco Labs 3C) to create differente message properties files, not using default webclient.properties.
And so making it easier to develop in larger teams and not interfere with translations.
After digging into the source code, I found out how:
You basically have 2 different beans dealing with messages:
1) the default Alfresco one:
This one uses:
org.alfresco.i18n.ResourceBundleBootstrapComponent
as defined and configured inside:
WEB-INF/classes/alfresco/core-services-context.xml
2) And the Webclient one:
org.alfresco.web.app.ResourceBundleBootstrap
(check out the src code of org.alfresco.web.app.ResourceBundleWrapper to find out more about it)
Webclient resources are loaded by this class, but it not defined yet in a normal Alfresco environment.
Instead, you have to define yourself.
So, if you want to use different webclient message files, you need to add them to the list.
So, create a file :
WEB-INF/classes/alfresco/extension/custom-webclient-context.xml
contents:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="resourceBundlesWebApp" class="org.alfresco.web.app.ResourceBundleBootstrap">
<property name="resourceBundles">
<list>
<value>alfresco.extension.custom-webclient</value>
</list>
</property>
</bean>
</beans>
And then put you're properties into:
WEB-INF/classes/alfresco/extension/custom-webclient.properties
Now you're action labels etc will work !
For inside the JSP, you off course still have to load them like this
<f:loadBundle basename="alfresco.extension.custom-webclient" var="customMsg"/>
hope this helped!
Kind regards
Dominique De Munck
