Delivering NLS Files for Authorized Values

You can deliver NLS files that contain translations for authorized values that may be defined in masks or in business rules used in the New, Properties dialog boxes or in the Search Results panel.

In the context of the Edit Properties window, and in the Search Results panel, you can use business rules to gray out some attribute edition boxes and to influence the list of authorized values. The edition box is replaced by a combo box. What is shown in the combo is what is valuated in the business rules but it is not translated. you can create a NLs file to translate these values for business rules computed authorized values and more generally for values defined in the masks.

  • The relation between the NLS translation file and the controlled attribute/type is based on a naming convention. Because an attribute is defined on a type, the name of the file is PLMAttrValue<TypeName>.CATNls, <TypeName> being the type that declares the attribute or one of its subtypes. In the following example, we are going to add a business rule triggered at initialization during the creation of a VPMReference (a product).
  • The CATNls file is required to display the comments associated with the attributes. It must encoded in UTF-8. In a Text Editor, enter: <meta charset="UTF-8"/>.

  1. From the Compass, click Social and Collaborative Apps , and select Data Setup.
  2. Right-click the PLM Business Logic Implementations Set ID and select Create a new Resource Table.
  3. Click OK in the PLM Resource Set dialog box.
  4. Double-click the resource cell corresponding to the Attributes initialization (PLMIdentificationInitialization) logical name.
    The Select a Business Rule window opens.
  5. Click ....
    The Business Rule window opens.
  6. Enter a business rule title and click OK.
  7. Enter the rule body. To do so:
    1. Set the type of ThisObject to PLMProductDS.
    2. Enter the following code into the editor:
    /* Inserted at the beginning of the rule to declare variables */
    let vp(ValuePointer)
    let li(List)
    
    /*Inserted to positioned two values Grey & Blue as authorized values for the description attribute*/
    li->Append("AuthorizedValues") /* Necessary to differentiate Help values from Authorized Values */
    li->Append("Grey")
    li->Append("Blue")
    vp = ThisObject->GetAttributeValuePointer("V_description")
    vp.AuthorizedValues=li
  8. Click OK twice.
    The business rule is created and the authorized values are displayed when creating a new object.
  9. To translate the values displayed in the above dialog box, create a CATNls file. As V_description attribute belongs to the PLMEntity type, we are going to create a file which name is PLMAttrValuePLMEntity.CATNls. Enter the following code into the text editor:
    /* Translates Blue into Bleu and Grey into Gris for the attribute V_description*/
    V_description.Blue= "Bleu";
    V_description.Grey= "Gris";
  10. Save your file in the runtime view in the following directory: intel_a\resource\msgcatalog.
    The translated values are now available when creating a new object.
    Note: To translate the authorized values of a given attribute, you must define them in a CATNls file corresponding to the type that defines this attribute. You can define these values on the type subtypes, which enables you to define a particular translation for a given subtype that will not be used for another subtype.