Question

The data dictionary pretty much forces every node in Alfresco to have a sys:locale value:

  <type name="sys:base">                                                                                                            
     <title>Base</title>                                                                                                            
     <mandatory-aspects>                                                                                                            
        <aspect>sys:referenceable</aspect>                                                                                          
        <aspect>sys:localized</aspect>                                                                                              
     </mandatory-aspects>                                                                                                           
  </type>  

  <!--                                                                                                                              
     Localization:                                                                                                                  
     If you add this aspect to a node, then the server will assume that all non-multilingual                                        
     properties apply to this locale.                                                                                               
  -->                                                                                                                               
  <aspect name="sys:localized">                                                                                                     
     <title>Translation</title>                                                                                                     
     <properties>                                                                                                                   
        <property name="sys:locale">                                                                                                
           <title>Locale</title>                                                                                                    
           <type>d:locale</type>                                                                                                    
           <mandatory>true</mandatory>                                                                                              
        </property>                                                                                                                 
     </properties>                                                                                                                  
  </aspect>   

I can imagine a whole lot of content where a locale does not make sense to me at all. Images, video, sound, code are a few examples. I would guess this locale is used for indexing tokenized string type properties. Still, I cannot see how that makes sense in the context of the content mentioned.

What exactly are the semantics of sys:locale and how is it used by Alfresco ?

Was it helpful?

Solution

The sys:locale serves as a fallback for the locale from the ContentData during indexing (if not set), so both @cm:content.locale and the tokenisation of d:content / d:text properties may / will be affected. In addition, sys:locale is used to differentiate the translations within the context of MultilingualContentService. On a site node, it affects the generated workflow descriptions for invitations.

sys:locale is not a real property in the sense that it is maintained in alf_node_properties - it is a virtual property much like sys:uuid derived from alf_node directly, which is why it affects even the content where it might not make much sense (apart from d:text property tokenization).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top