Locked History Attachments

I18NConventions

I18N Resource Bundle Conventions

Plugin

- Download the Eclipse ResourceBundle editor plugin: http://sourceforge.net/projects/eclipse-rbe/

- Extract the archive, and copy the contents to the eclipse/plugins folder.

- Restart eclipse

- Go to Preferences > Resource Bundle Editor > Formatting and set:

  • "Show Generated By... header comment" to false
  • "Convert unicode values to \uXXXX" to false
  • "Align equal signs" to false
  • "Group keys" to false
  • "Keep properties with empty values" to false

- In Preferences > General > Editors > File Associations, select the *.properties content type, and set the ResourceBundle Editor as default

General Guidelines

  • keys are separated by dots (.) that separate phrases (do not use dots in: this.should.not.have.dots)
  • words in phrases inside key names should be camel cased or concatenated

Format Description

Purpose

All formats of keys have a part of the syntax where the purpose of the key is specified, this determines unanbiguously where that key is to be used. The purposes are at the moment:

  • link - used in url text
  • button - used button text
  • title - used in headings or anything equivalent in purpose
  • label - used in form fields or table column headers
  • message.feedback - status message indicating the result of some operation
  • message.warning - warning message produced by some operation
  • message.error - error message produced by some operation
  • message.exception -
  • message.help - help text, information boxes, etc.

Generic Keys

<purpose>.<key>=I18N Text 

Examples: button.ok=Ok

Domain Slot Keys

label.<class>.<slot>=I18N Text

The class is striped out of the package up to the domain part, that is, net.sourceforge.fenixedu.domain.accounting.Receipt becomes accounting.Receipt

Examples: label.accounting.Receipt.receiptDate=Data

Portal Specific Keys

<functionality>.<purpose>.<key>=I18N Text

The functionality is the path of the key in the interface, with the portal string stripped out as the resource bundle will have that name (specified ahead).

Example:

Resource Bundle Files

  • Each portal should have its own Resource Bundle, these are portal specific resource files and should only contain portal specific keys
    • format: <Portal>Resources_<Language>.properties
  • Generic keys are stored in a common Resource Bundle
    • CommonResources_<Language>.properties
  • Domain model slot keys
    • DomainResources_<Language>.properties
    • This will likely be a big one, if later we think its wise we can split the domain keys into the packages, for example [..].domain.accounting.Receipt would have its keys in a DomainAccountingResources_<Language>.properties.

  • A given source file, like a jsp, a xml, or a java file, should have access, at most, to the common resources, to the domain resources and to the resource bundle of the corresponding portal, never will a source file have access to a resource bundle of another portal.