I know Alfresco stores messages and i18n labels for the UI in ".properties" files,
I would like to know what are the Alfresco conventions to write those files
How it is better to write those key?
It is correct to write form.form-id.title=myTitle or should I use another convention?
Do you use another prefix like the namespace (myc.form.form-id.title=myTitle)
Thanks to all
Indeed, if you want to set labels in properties files for a custom form, you have to keep Alfresco standards. See comments in tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml :
If a type has been specified without a title element in the content model, or you need to support multiple languages, then an i18n file is needed on the Repo AMP/JAR extension side for the type to be visible when creating rules:
custom_customModel.type.custom_mytype.title=My SubType
Used by the "Change Type" action. For the type to have a localised label add relevant i18n string(s) in a Share AMP/JAR extension:
type.custom_mytype=My SubType
But if you define your own properties in custom Java code and spring beans, maybe could you keep choose the most comprehensive name for a user or admin sys which will have to configure your properties.
To answer to your question, I don't know any standard for these new properties.
Hope it helps
I am studying about checkstyle and eclipsecs plugin. When I create new "check" (by open new module), i noticed that they have Advanced tab with some strange features inside: id, comments, tokens (except custom check messages - it is obvious). You can see in my screenshot.
I did read their documents but haven't seen any explanation about these options.
Could you please explain it for me? Thank you very much.
These are possible properties in the checkstyle.xml which the Eclipse-CS visual editor is creating.
A check may be assigned an ID, which can later be used to refer to it, e.g. when suppressing it under certain circumstances. This is useful if you use the same type of check multiple times with different properties. This answer gives an example which makes use of this feature.
The comment is Eclipse-CS specific metadata. It is really just a comment text which is saved as check metadata (metadata element). But it is interpreted by the Eclipse checkstyle plugin only, which shows it again on the advanced tab.
The translate tokens checkbox adds a natural language (and possibly even localized) description to the list of tokens, if such list is present in the selected check. In your example, it is not, so the checkbox has no effect on this check (but it does on others, as that one is a global checkbox!).
Following are some screenshots with an example of the WhitespaceAround check, which supports lots of tokens.
Tokens list "raw" (no translation or sorting):
Tokens list "translated":
Tokens list "translated" and "sorted":
The sorting also affects the order in which tokens are written to the generated configuration file. The sorting seems to have to do with the numerical values of these tokens. Since they are internal and not visible to us users, it seems to have little use. Example:
Not "sorted":
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,
BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,
LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,
LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,
MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,
SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND,WILDCARD_TYPE,GENERIC_START,GENERIC_END"/>
</module>
"Sorted":
<module name="WhitespaceAround">
<property name="tokens" value="COLON,NOT_EQUAL,QUESTION,DIV,DIV_ASSIGN,BXOR,BXOR_ASSIGN,
MINUS,LCURLY,RCURLY,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND,BAND,LAND,BAND_ASSIGN,MOD,
MOD_ASSIGN,PLUS,PLUS_ASSIGN,LT,GENERIC_START,SL,SL_ASSIGN,LE,ASSIGN,MINUS_ASSIGN,
EQUAL,GENERIC_END,GT,GE,SR,SR_ASSIGN,BSR,BSR_ASSIGN,BOR,BOR_ASSIGN,LOR,LITERAL_ASSERT,
LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,DO_WHILE,
LITERAL_RETURN,SLIST,LITERAL_SYNCHRONIZED,LITERAL_TRY,WILDCARD_TYPE,LITERAL_WHILE"/>
</module>
The examples were created with Eclipse-CS 6.14.0.
I have a Sitecore site where many of the pages are assembled mainly from various sublayouts pointing at datasources elsewhere in the content tree.
Here's a basic example of the problem. Someone viewing a page about apples might see the word 'apple' 10 times. However, Lucene will not index the Apple page item for that word because it's stored in other items.
I'm sure this must be a common issue but I can't seem to find any advice on it.
This is a common issue and there's a solution in this screencast at 38:29:
http://www.techphoria414.com/Blog/2012/May/Sitecore_Page_Editor_Unleashed
Grab the sample code on the page and look at the class PageEditor.Unleashed.Search.DynamicFields.VisualizationField which grabs all data sources and adds their content to the "_content" field in the config
<dynamicField type="PageEditor.Unleashed.Search.DynamicFields.VisualizationField, PageEditor.Unleashed.Classes" name="_content" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
Can anyone provide me sample code to develop a struts i18n application containing two jsp pages with two buttons (a single toggle button) to switch b/t two languages?
I am a new to struts.
You can start with this link for some introductory info into internationalized messages then basically, for Struts i18n messages, you would use the <bean:message> tag. The Action class has a method you can use to set your desired locale in session scope and the message tags will pick it up from there.
There are plenty of examples you can find on the web (even if not as specific as you demanded :D). Maybe this article can get you started.
Download sample app from Struts site These sample application are packaged as WAR files. You can import HelloWorld.war from your eclipse and run index.jsp
You don't really need Struts to accomplish internationalization. You can use the JSTL formatting tags. You can use the fmt:bundle tag in your JSP to set the resource bundle to use. Basically a resource bundle is a collection of property files, one for each language that your application supports, that have a common base name. The fmt:message tag will print a message from the resource bundle based on a key. The last thing you need to do is to use the fmt:setLocale tag to actually set the locale (in other words, which of the resource files in the bundle to use) based on what language you want to display.
A good place to start is here:
http://docs.oracle.com/javaee/1.4/tutorial/doc/JSTL6.html
I'm investigating the use of Eclipse as a platform and I am trying to figure out how a plugin provides configuration. For example, say I have a plugin to display a user defined message. Further, I want that user defined message to be configured by the user. What is the standard way for the user to edit this message in the platform? Is there any documentation for this?
As you mentions in the comments, the article Preferences in the Eclipse Workbench UI described the way developers define preference pages for their plug-ins.
By use of the preference store in conjunction with the preferences dialog and provided field editors a plug-in developer can quickly put together a user interface for managing preferences.
The color preference page is an example of a simple page that uses a single JFace field editor to manage its values
That way, you can define several type of custom values configured by the user:
text field
set of predefined values (dropdown list)
array of values
Example:
Found it: http://www.eclipse.org/articles/Article-Preferences/preferences.htm Wow, Stackoverflow helps a lot! You only need to post and it magically comes up in Google
Sorry to VonC but I had already found it before he posted the answer :-/