Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Translating is very straight forward. Open the base resource bundle (admin.properties) for the core/plugin/project in a resource bundle editor like RB Manager or the Eclipse ResourceBundle Editor. Use the tool to create a bundle for the locale you require e.g. en_AU (Australian english), and start translating the key-translation pairs.

Noteinfo

Regarding keys: At the moment no comments are stored for resources to say where they are used or how. Instead that information is encoded in the resource key. For example webtop labels and descriptions are stored inside a structure corresponding to the webtop structure - webtop.admin@label, content type forms are stored in a structure like coapi.typename.properties.property@label. Other keys reflect the area of the webtop (e.g. fixtree) or part of FarCry framework (e.g. workflow) they are used for, the use (e.g. workflow.buttons), the specific page element (e.g. workflow.buttons.save), then the element attribute (e.g. workflow.buttons.save@label).

...

Log into the webtop, edit your profile, select the new locale from the list, and save. When you reload the webtop you should find that is using your translations.

Warning

Some webtop elements are available as translated content but aren't included in the base bundle, and others are completely hard coded. An online tracking solution for these elements is in the works, but for the moment these should be documented in a ticket.

Developers

Resource bundles are accessed by FarCry automatically through the webtop and the content type translations, and manually through the application.rb component.

...

Argument

Description

Default Value

rbString

The key being requested. Not changed to key for backwards compatability

See getResource

substituteValues

Either a simple value to replace one value or an array to replace several. Variables defined in the resource string as {1} ... {n}

Required

default

The default value (used if the key isn't found)

The key string

Updating

...

Creating the base bundle

Developers who want to support community efforts to translate their plugins should include a complete base resource bundle in their project. To recap: this is a file called /packages/resources/admin.properties in your plugin. This isn't necessary if the code is not going to be released or if you're happy for other developers to complete this next step. By default FarCry handles the lack of a resource bundle invisibly by returning the default values provided in code.

The Resource Bundle Plugin provides functionality for automatically generating bundles based on default values, base bundles, or even with the Google Translate API. But it is important to remember that the automatic generation of the base bundle only handles resources that have been "touched". This means that a button label (for example) will only be known to the plugin if you have actually accessed the form.