7.8.12.7.  Translation functions

Prerequisites

In order for the translations in PARTdataManager (line description [Row Label], 2D derivation, PDF data sheet [Data sheet], etc.) are actually displayed, the following requirements must be met:

  • The desired catalog language must be set in PARTadmin (either as default of the program interface or explicitly).

  • The variables to be translated must be declared in PARTproject on the General tab page under Translatable variables [Translatable Variables].

    Only then will they be displayed on the Translation tab page.

  • The translations must be displayed in black on the Translation tab page. A grayed-out display only indicates a translation suggest ion. To accept suggestions, click in the desired field and confirm with the Return key or click with the secondary mouse button in the desired field, select the context menu command Edit value and confirm with OK.

    (Translations are stored in the def file of the project.)

Functions

In the following the functions are exemplarily explained:

You can find some examples in the training catalog in the "translation " directory.[90]

  • Example 1 - Translation of a fixed term

    Extract from dir.def file

    [head_cap_bolts]
    German=Zylinderschrauben
    Default=Head Cap Screws
    English=Head Cap Screws

    Insert the default term into the function TRANSLATE.

    TRANSLATE('Head Cap Screws')

    [Note]Note

    Text must be enclosed in single quotation marks.

    For catalog language "german" the result would be: "Zylinderschrauben"

  • Example 2 - Translation of a variable

    [Note]Note

    When using a variable in the form $VARIABLENNAME. its internal value is always returned.[a] However, if, for example, the visible, translated value is to be used in the line description [Row Label], data sheet [Data sheet], 2D derivation, etc., you can use the "TRANSLATE(VARIABLENNAME)" function.

    [a] This is important because there are feature algorithms that access and work with the internal value.

    Here in this example the function TRANSLATE is used together with a help variable.

    Extract from dir.def file

    [head_cap_bolts]
    German=Zylinderschrauben
    Default=Head Cap Screws
    English=Head Cap Screws

    1. Here in the example, in the first step, a fixed value is assigned to a variable. Just as well you can directly reference to a table variable. On this see example 3.

      1. Attribute algorithm

      A = 'Head Cap Screws'

    2. Translation of the variable and assignment to a help variable.

      2. Attribute algorithm

      B = TRANSLATE(A)

      When querying "B" for catalog language "german" the result would be: "Zylinderschrauben"

  • Example 3 - Translation of a variable: Translating text in the line description [Row Label]

    [Note]Note

    The TRANSLATE (VARIABLENNAME) function cannot be used directly under PARTproject -> General -> Line description [Row Label] tab page . The alternative procedure is explained in this example.

    Initial situation: The TXT column contains values to be translated.

    1. Use the TRANSLATE function to translate the values of the TXT variable using the feature algorithm and assign them to the XTXT auxiliary variable:

      XTXT = TRANSLATE(TXT)

    2. You can now use XTXT to define the NENN variable.

      NENN = '$D. $XTXT.'

    3. Use NENN for the line description [Row Label].

    Result:

  • Example 4 - Translation of a variable: Translating text in the line description [Row Label]

    [Note]Note

    When using a variable in the form $VARIABLENNAME. its internal value is always returned.[a] However, if, for example, the visible, translated value is to be used in the line description [Row Label], data sheet [Data sheet], 2D derivation, etc., you can also use the function "$VARIABLENNAME(SRC=VALDESC). " as an alternative to "TRANSLATE".

    [a] This is important because there are feature algorithms that access and work with the internal value.

    Initial situation: The TXT column contains values to be translated.

    Enter the following expression under PARTproject -> tab page General -> Line description [Row Label], enter the following expression:

    $TXT(SRC=VALDESC).

    The following figures clarify the difference between the simple use of a variable an the above function:

    Line description [Row Label] with use of "$Variable name."

    Line description [Row Label] with use of "$Variable name."

    Result: Row description [Row Label] NOT translated: The table value is translated by default

    Result: Row description [Row Label] NOT translated: The table value is translated by default

    Line description [Row Label] using the function "$Variable name(SRC=VALDESC)."

    Line description [Row Label] using the function "$Variable name(SRC=VALDESC)."

    Result: The line description [Row Label] is now also translated

    Result: The line description [Row Label] is now also translated




[90] $CADENAS/training/training.cip