cancel
Showing results for 
Search instead for 
Did you mean: 

model properties file (for localization)

aweber1nj
Champ in-the-making
Champ in-the-making
What is the rule about how to actually enter type/aspect/property names in the .properties file for localization?

By that I mean, I read the example in Mr. Potts' excellent guide to Custom Content Models, but it doesn't mention "why" when entering the property names in the .properties file the colons ( : ) are substituted to underscores ( _ ) when identifying the namespace:name.

For example, sc:whitepaper appears to become sc_whitepaper – but no explanation is actually given as to why.

Is there a ruleset that I can follow?  For example, what if I have a colon later in a name like "sc:whitepaper:folder".  Do both colons get swapped-out for underscores???  Why?

Thanks for anyone who can shed some light on this.
-AJ
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
It's because the : character is a reserved character in a java properties file.     For example it can be a directory separator character on some O.S. and is treated as part of the name.

To be honest it could probably be better,   but its been this way for a long time.

aweber1nj
Champ in-the-making
Champ in-the-making
Ok, then how does Alfresco know which (replacement) underscores to interpret as colons, and which to use literally?

aweber1nj
Champ in-the-making
Champ in-the-making
Sorry, this actually may be irrelevant. 

I was following-along some of Jeff Potts' modeling tutorial and in my simple experiments, I neglected to take a step back and think about how localization properties are typically handled and that the label-id is mostly-irrelevant in naming, as long as you keep it consistent.

I'll be sure to check-back if I have trouble, but I think I'm ok.  Sorry to be a pest.

-AJ