Library Phrase Data Source Example

You can use Library Phrase data sources in several ways to print frequently used text content, whether in one language or several. This topic provides a procedure that you can use to print one phrase on your template in two places and in two languages: your default language and a different language that you specify at print time.

Consider the following scenario:

A distributor ships perishable produce from one country to another. Regulations require that the shipping containers use a label that has cautionary text in two languages: the language of the originating country and the language of the destination country.

You want to create a template in BarTender that uses two text objects. The first text object contains the phrase in your default language (in this example, the default language is English [United States]). The second text object contains a translated version of the phrase (in this example, the phrase is translated into German [Germany] and Spanish [Spain], and the print operator chooses which language to print the phrase in). When the print operator selects German (Germany) at print time, the resulting label resembles the following.

The procedure that follows describes how to create the Library Phrase data sources that are used for this label and how to configure the text objects on the template to print the phrase in the languages that you want.

Step 1: Create the phrase library and connect it to the document

ClosedTo create the phrase library and connect it to your document

You can use Data Builder to create a phrase library, or you can use BarTender, as in the following procedure. When you use BarTender, the phrase library that you create is automatically connected to your BarTender document. To do this, follow these steps:

  1. In BarTender, right-click Libraries on the Data Sources pane of the Toolbox, and then click Create a New Library.

  2. In the Create a Phrase Library dialog, specify a name for the library and the Data Builder database that you want to add it to, which can be an existing database or a new one that you create. Then, click OK. The Edit Library dialog opens.

  3. Use the Edit Library dialog to add the following phrases to your library. The first phrase is in English, the second is in German, and the third is in Spanish: 

    This box contains perishable items.

    Diese Kiste enthält verderblicher Waren.

    Esta caja contiene artículos perecederos.

     

    To do this, follow these steps: 

    1. In the Edit Library dialog, add the English (United States) phrase manually by clicking the empty cell in the English (United States) column and then entering the phrase.

    2. Add the German (Germany) and Spanish (Spain) languages to the library. To do this, click Add Language on the ribbon, and then select German (Germany) and Spanish (Spain) in the Select New Language dialog.

    3. In the German (Germany) column, add the German phrase in the same row as the English phrase is in.

    4. In the Spanish (Spain) column, add the Spanish phrase in the same row as the English phrase is in.

    5. Click OK.

Your new phrase library appears under Libraries on the Data Sources pane of the Toolbox.

Step 2: Configure the languages for the document

ClosedTo configure the languages that you want to print your document in

In this procedure, you will configure German (Germany), and Spanish (Spain) to be available to select in the Print dialog at print time so that you can specify the language that you want to print the second text object in. You use the BarTender Document Options dialog to configure the languages, as follows:

  1. In BarTender, click BarTender Document Options on the File menu to open the BarTender Document Options dialog.

  2. On the Languages tab, set the Number of Languages in Document option to 2.

  3. Configure the first listed language ("Number 1") in the languages table to always be English (United States). To do this, leave the "Number 1" language set to the default of English (United States), and leave the Select at Print-Time check box unselected.

  4. Configure the second listed language ("Number 2") in the languages table to default to German (Germany) but to accept language selection at print time. To do this, follow these steps: 

    1. Click the ellipsis (...), and then select German (Germany) in the Select New Language dialog.

      The language and locale must match the language and locale that are specified in the phrase library.

    2. Click to select the Select at Print-Time check box for the "Number 2" language.

  5. Click OK to close the BarTender Document Options dialog.

Step 3: Create and configure the first text object

ClosedTo create and configure a text object for the English phrase

  1. Drag the phrase library from the Data Sources pane of the Toolbox to the location on the template where you want to place the text object. The Select a Phrase dialog opens.

  2. In the dialog, select the phrase that you want for the text object. (In this example, there is only one phrase.)

  3. Leave the preview language set to English (United States), and then click OK to close the dialog.

  4. Double-click the text object to open the Text Properties dialog, and then make sure that Language #1 - English (United States) is selected in the Language list on the Data Source pane of the Data Sources property page.

  5. Click Close to close the Text Properties dialog.

Step 4: Create and configure the second text object

ClosedTo create and configure a text object for the translated phrase

  1. Add a new text object to the template, and then double-click it to open the Text Properties dialog. Alternatively, right-click the object, and then click Properties.

  2. On the Data Source tab of the Data Sources property page, click for the Type field to start the Change Data Source Type wizard. Select Library Phrase for the data source type, and then click Next.

  3. Click for Phrase ID to open the Select a Phrase dialog, select the same phrase that you selected for the first text object, and then click OK to close the dialog and return to the wizard.

  4. In the Language list, select Language #2 – Selected at print-time, German (Germany).

  5. Click Finish to close the wizard.

  6. Click Close to close the Text Properties dialog. The German phrase appears on your template. However, you will be able to change this to Spanish if you want when you run the print job.

Step 5: Select the language to print the second text object in

You can use the Print dialog to select the language to print an object in, or you can configure a data entry control so that the print operator selects the language at print time.

ClosedTo use the Print dialog to select the language for the translated phrase at print time

  1. Click to open the Print dialog, and then click the Languages mini-tab.

  2. In the "Number 2" list, select the language that you want to print the phrase in. The object will be printed in this language when the print job runs.

    For example, if you select Spanish (Spain) and then click Preview, your template resembles the following.

ClosedTo use a data entry control to select the language for the translated phrase at print time

You can use this procedure for radio button list controls and for dropdown list and list box controls whose type is Single Column.

  1. In BarTender, click the Form tab at the bottom of the design area to switch to Data Entry Form view.

  2. On the object toolbar, click , and then click Dropdown List, List Box, or Radio Button List.

  3. Click the location on the data entry form where you want to place the control.

  4. Double-click the control to open the Control Properties dialog. Alternatively, right-click the control, and then click Properties.

  5. In the left navigation pane, click Linked Data Source.

  6. In the Data sources area, click Language.

  7. Click Close to close the Control Properties dialog. Notice that your control now lists the languages that you configured to be selected at print time (English, German, and Spanish).

  8. On the main toolbar, click Print Preview. The data entry form is displayed. Select the language that you want, and then click Preview. A preview is displayed that shows that the second text object will be printed in this language when the print job runs.

    For example, if you select Spanish (Spain) and then click Preview, your template resembles the following.