cancel
Showing results for 
Search instead for 
Did you mean: 

Just can't get localizations to show

ustamills
Champ in-the-making
Champ in-the-making
I've tried following Jeff Potts <a href="http://forums.alfresco.com/forum/developer-discussions/content-modeling/custom-content-model-tutoria...">article</a>, plus I've been reading the <a href="http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Content_Model_Schema_Tour">wiki article</a> about the content model.

I just can't figure out the secret sauce.  I know I have my files in the right place, because I intentionally mis-spelled the path to the properties file as a means of testing.  It complained until I put it back. So that tells me it saw the registration and the actual file.

I also know the customized document types are being found because I can set the new doc types via a rule or directly in SHARE.  However, my forms show the ugly non-localized field labels. An example:  I have three fields for a contract and the labels look like this:  al:vendor, al:effectiveStartDate, al:effectiveEndDate.

Here are my code snippets that I thought might make the forms better.

From the custome content model (ellided to save space)




<model name="al:altourmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
  <!– Optional meta-data about the model –>
  <description>Altour Model</description>

  <namespaces>
    <namespace uri="http://www.altour.com/model/content/1.0" prefix="al" />
  </namespaces>

    <!– ================== Contract =================== –>
    <type name="al:contract">
      <title>Altour Contract</title>
      <parent>al:doc</parent>
      <properties>
        <property name="al:vendor">
          <type>d:text</type>
          <mandatory>false</mandatory>
        </property>
        <property name="al:effectiveStartDate">
          <type>d:datetime</type>
          <mandatory>false</mandatory>
        </property>
        <property name="al:effectiveEndDate">
          <type>d:datetime</type>
          <mandatory>false</mandatory>
        </property>
      </properties>
    </type>



And here is a snippet from my messages file. I tried several different syntaxes below because the one I thought the Wiki article said I should use (the last) didn't work either.


############################################################
#
#  Contract
#
type.al_contract=Contract
search.form.desc.al_contract=search for Contracts
property.vendor=Vendor
al_altourModel.property.effectiveStartDate=Effective Start Date
al_altourModel.property.al_effectiveEndDate=Effective End Date



I've tried every permutation I could come up with to get the labels to change, and I get nothing.
Any help would be GREATLY appreciated.

Drew
1 REPLY 1

ustamills
Champ in-the-making
Champ in-the-making
*** FOUND IT !!!  ***

I was NOT aware (don't know if the documentation wasn't clear or I was just dense) that the link between the forms label and the label in the properties field is exactly here:

In share_config_custom.xml

<form>
  <field-visibility> … </field-visibility>
  <appearance>
     <field id="al:vendor" label-id="al_altourModel.property.al_vendor">
       …
     </field>
   </appearance>
   …
</form>

And in my .properties file:


#######################
#
# Contract
#

al_altourModel.property.al_vendor=Vendor


The important part above is the attribute called "label-id".  It MUST match the left-hand side of the property pair in the properties file (notice that both above are spelled exactly "al_altourModel.property.al_vendor"). 

I'm guessing here (someone please correct me) that it doesn't even matter WHAT you name it in the properties file as long as it is consistent.  I say this because Jeff Potts uses "prop.XXX" to identify a documents property and the Wiki article calls it "property.XXX" (notice 'property' is fully spelled out there).  Plus the Wiki article talks about a very particular naming scheme that prepends all property names with model names and Jeff didn't even mention or use it.

Once I got the label-id to match up with the name in the properties file, it WORKED!

My specific error was leaving out an entire
<appearance>
section because I thought the default would accept my properties definitions if I just got the freakin' syntax right.  And it was never about the syntax.

So, there are my conclusions and experience.  Someone please clue me in if I got it wrong.  If I have the right of it, I'll probably suggest some Wiki edits to make this more clear.