Versions Compared

Key

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

...

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.

Examples

Custom Admin

To i18n the webtop custom admin XML file you can define items as in the following example.

Code Block

<?xml version="1.0" encoding="utf-8"?>
<webtop>
  <section mergeType="merge" id="content">
    <subsection mergeType="merge" id="farGallery" label="[Image Gallery]">
      <menu mergeType="merge" id="farSubSection" label="[Image Gallery]" labelType="value">
        <menuitem mergeType="merge" id="farimagegallerylist" label="[Image Galleries]" 
          link="/admin/customadmin.cfm?module=customlists/farimagegallery.cfm&amp;plugin=farcryimagegallery"
        />								
      </menu>
    </subsection>
  </section>
</webtop>

For clarity, I tend to use the brackets around items that should be translated. It helps to locate items that haven't been done yet. The admin.properties file to translate the above entry is as follows:

Code Block

webtop.content.farGallery@label=Image\ Gallery
webtop.content.farGallery.farSubSection@label=Image\ Gallery
webtop.content.farGallery.farSubSection.farimagegallerylist@label=Image\ Galleries

The first item, webtop, is used to denote that this is for the webtop section of the site. The rest of the key is somewhat like an xpath statement to the thing you want to translate. They are the IDs of each node in the XML, and then the final statement is the name of the attribute preceded with an @ sign.

Content Types

To translate the labels for your content types is similar to how