cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Localizing properties from my content model

irenailievska
Champ on-the-rise
Champ on-the-rise
In a tutorial about content modeling I saw that for localization you can use  ex. type.mm_document=Document and it works also for aspect, but I can`t make it work when I use prop.mm_index=Index. I have tried using
prop.mm_index=Index
mm_index=Index
mm.index=Index
mm_mymodel.property.mm_index=Index
mm_mymodel.type.mm_document.property.mm_index=Index

and what not….
I really need help.

I created a bean

< beans >
    <  !– Add Project Share messages –>
    <  bean id="${project.artifactId}_resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
        <  property name="resourceBundles">
            < list>
                <   value>alfresco.module.${project.artifactId}.messages.mmModel< /value >
            < /list>
        < /property>
    < /bean>
< /beans>
4 REPLIES 4

openpj
Elite Collaborator
Elite Collaborator
Alfresco Share properties labels are taken from Alfresco Repository configuration.

From the Alfresco Repository side you should localize your models following the documentation:
http://docs.alfresco.com/4.2/concepts/content-model-localization.html

This means that in the Alfresco side you should declare the new properties labels using a property such as:

prefixModel_localNameModel.property.prefixModel_localNameProperty = yourLabel

For example considering the standard attribute Name:
cm_contentmodel.property.cm_name.title=Name

Hope this helps.

I followed this tutorial but I realized that the properties in my case don`t have the prop.* they are all mm:*
http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html#propertie...

irenailievska
Champ on-the-rise
Champ on-the-rise
I am a beginner with alfresco and I am having trouble still. Before I had created a file myModel.properties in a  folder messages, and a web-extension folder with the bean
< beans >
< !– Add Project Share messages –>
< bean id="${project.artifactId}_resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
< property name="resourceBundles">
< list>
< value>alfresco.module.${project.artifactId}.messages.mmModel< /value >
< /list>
< /property>
< /bean>
< /beans>

They were in the Alfresco Share, and they worked for types and aspects but not for properties.
Then I put them in the Alfresco Repo in the same locations accordingly. But still have no success. I tried to add the following code
< property name="labels">
< list>
< value>alfresco/extension/myModel.properties</value>
< /list>
< /property>

in the bean where my content model was registered but I still can not make it to work.
Sorry I am such a pain but I followed the tutorial link you put and many others. Apparently I am making something wrong or not making something. In some of the tries I could not even start the repo because it kept giving me errors that it could not find the bundle — what ever that means.
Please Smiley Happy Help

irenailievska
Champ on-the-rise
Champ on-the-rise
I solved it Smiley Very Happy I was supposed to add
< config evaluator="aspect" condition="nc:Aspekt1">
     < forms>
          < form>
              < field-visibility>
                   < show id="mm:verzion" />
              < /field-visibility>
              < appearance>                
                 < field id="mm:verzion" label-id="prop.mm_verzion" />
               < /appearance>
           < /form>
      < /forms>
    < /config>


Thanks anyway