Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

This document introduces the message bundle file in CollectionSpace's User Interface (UI) layer.

It also describes how you can change text appearing on many of CollectionSpace's pages by editing the contents of an overlay message bundle file, within the tenant folder for your museum.

Contents

About the message bundle file

The message bundle file in CollectionSpace's UI layer contains multiple lines of text. Each line contains a different text label whose value you can change, which will in turn change the text displayed in a specific place or places on CollectionSpace's web pages.

Within the source code tree for CollectionSpace's UI layer, in a folder named ui, you can find the default message bundle file in src/main/webapp/defaults/bundle/core-messages.properties. This file contains an extensive set of text labels, which are inserted into designated places within HTML templates when CollectionSpace's web pages are displayed in a browser.

You can override the values of any of those default text labels, or add new ones to supplement them, by editing an overlay message bundle file, bundle/core-messages.properties-overlay, inside the tenant folder for your museum. (See Finding your tenant folder.)

If that bundle folder or the core-messages.properties-overlay file don't already exist in your tenant folder, you can create either or both, as needed. You can initially create the core-messages.properties-overlay as an empty file, using your favorite text editor.

Format of each line in the message bundle file

The format of each line in the message bundle file consists of a property and a text label, separated by a colon (":") and a space character:
property: text label

The format of that property, in turn, consists of page name (for a web page, dialog, etc.) followed by an item name specifying some specific text item (such as a field label or header) that will be displayed on that page's HTML template. These are separated by a hyphen ("-"): pagename-itemname

For instance, the label that appears next to the Current Owner field on the Intake procedure page is configured via the following line in the default message bundle file:

intake-currentOwnerLabel: Current Owner

By copying that line to your tenant's overlay message bundle file, and editing it there, you can change the value of that text label as it will appear on one or more HTML pages in CollectionSpace.

If you want to keep some (or even nearly all) of the default text labels "as is," simply don't include their text labels in your tenant's core-messages.properties-overlay file. Your tenant's file can be "sparse," nearly empty, containing only the changes you want to make from the defaults.

To delete (aka empty or blank out) a text label, add the relevant property to your tenant's core-messages.properties-overlay file, but give it an empty value (i.e. nothing after the colon (':') separator), like this:

intake-currentOwnerLabel:

Identifying which text label to change in the message bundle file

To identify which text label you need to change in your overlay message bundle file in your tenant folder, to change some text displayed in a specific place or places on CollectionSpace's web pages:

  • Start by scanning the section of the message bundle file that contains text labels for the page (or dialog, etc.) on which you want to change some text, to see if you can readily spot the right label to change. For instance:
    • Text labels beginning with acquisition- pertain to the Acquisition record page.
    • Text labels beginning with login- pertain to the login ("Sign In") page.

Often, by merely scanning those labels, you can find the appropriate text label to change. If that doesn't help, try one of the following techniques:

  • Log into a CollectionSpace system.
  • Open your browser's web developer tool.
  • Right click on a piece of text on any of CollectionSpace's pages, and select the Inspect Element choice, or any similar choice, from the menu. (In some developer tools, you can also use a "magnifying glass" or "inspector" tool for this purpose, and just directly click on the item you wish to inspect.) That will display the HTML markup surrounding that text. In that markup, you may be able to identify a relevant class="" attribute, whose text should look a whole lot like that of the text label you want to change. Examples:
    • An item of text on the Acquisition page, whose class="" attribute is csc-acquisition-acquisitionNote-label, is associated with the text label acquisition-acquisitionNoteLabel in the default message bundle file.
    • An item of text on the login ("Sign In") page, whose class="" attribute is csc-login-rologin, is associated with the text label login-rologin in the default message bundle file.

For instance, using Firefox's Tools->Web Developer...->Inspector tool:

OR

  • Inside the folder for the UI source code tree, open the appropriate HTML template file in a text editor, and search for the relevant class="" attribute that appears to match the text that you want to change. Most of the locations in CollectionSpace's HTML templates, that text is inserted from text labels in message bundle files, will have a class="" attribute beginning with csc.
    • You can find these HTML templates inside the ui folder that contains the UI layer source code tree, the within src/main/webapp/defaults/html folder and its sub-folders.

Unknown macro: {multi-excerpt}

Text labels for fields

There's a specific pattern that can help you find and change the text label that is displayed next to a field. (You should also follow this pattern if you've added a new field, and want to create a brand new text label for it.)

In CollectionSpace's HTML templates, the tag for the label next to a field will have a class="" attribute beginning with csc, of the form:

csc-{recordid}-{fieldid}-label

In a message bundle file, the corresponding text label for that field should then typically be of the form:

{recordid}-{fieldid}Label: value for that label goes here

with the csc- prefix removed from the beginning and, in the fieldid, with all hyphens removed and words run together in camelCase. (Following those rules, -label also gets converted to Label at the end.)

An example might help make this clear: in the HTML template file for the Acquisition record, AcquisitionTemplate.html, the Acquisition Note field has two tags: one for its text label - the name that appears above the field - and the other for the field itself:

<div class="info-pair">
  <div class="header">
    <!-- This is the tag for the label that appears above the field -->
    <div class="label csc-acquisition-acquisitionNote-label"></div>
  </div>
  <div class="content">
    <!-- This is the tag for the field itself -->
    <textarea rows="4" cols="30" class="input-textarea csc-acquisition-acquisition-note" />
  </div>
</div>

In the message bundle file, the text label that corresponds to the first of those tags, <div class="label csc-acquisition-acquisitionNote-label">, is:

# Corresponds to the class csc-acquisition-acquisitionNote-label in the HTML template
acquisition-acquisitionNoteLabel: Acquisition Note

Changing a text label in a message bundle file

Unknown macro: {multi-excerpt}

This step-by-step example helps explain how to change text labels:

To change the text that appears next to the Current Owner field on the Intake procedure page to simply Owner, you will copy the appropriate line from the default message bundle file into the overlay message bundle file for your own tenant (museum), and then change its value:

  • In a text editor, open the default message bundle file, src/main/webapp/defaults/bundle/core-messages.properties
  • Copy the following line from that file to the Clipboard, containing the text label that supplies that text:
    intake-currentOwnerLabel: Current Owner
    
  • In a text editor, open the message bundle file for your tenant (museum), src/main/webapp/tenants/{your tenant folder}/bundle/core-messages.properties-overlay. (You can create that file - and the bundle folder that contains it - if either or both don't already exist.)
  • Paste in the line from the Clipboard into the core-messages.properties-overlay file.
  • Modify the value of that text label to Owner:
    intake-currentOwnerLabel: Owner
    
  • Save the modified file.

Copying your changes to the CollectionSpace server

 Click here to read these instructions (included in many documents on this site) ...
Unknown macro: {multi-excerpt-include}

(Or instead see Configuring CollectionSpace's User Interface (UI) Layer - An Overview.)

  • No labels