powered by CADENAS

Manual

Manual

6.8.5.2.  Translation functions

Preconditions

In order for translations to be really displayed in PARTdataManager (Row Label, 2D derivation, PDF- Data sheet, etc.), the following preconditions have to be fulfilled:

  • In PARTadmin, the desired catalog language has to be set (either as default of the user interface or explicitly).

  • The variables to be translated have to be stated in PARTproject, on the tabbed page General under Translatable Variables.

    Not until they are stated here they are displayed on the tabbed page Translation.

  • The translations have to be displayed on the tabbed page Translation in black color. A grayed out display just signalizes a translation suggestion. In order to overtake a suggestion, click into the desired field and confirm with the return key or click into the desired field with the secondary mouse key, 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:

Some examples are found in the training catalog, in the directory "translation".[53]

  • 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 has to be inside 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. always its internal value is returned.[a] However, if you want to work with the visible, translated value (in the Row Label, Data sheet, 2D derivation, etc.), you can use the function "TRANSLATE(VARIABLENNAME)".

    [a] This is important, because there are attribute algorithms, which access the internal value by this in order to work with it.

    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: Translation of text under Row Label

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

    1. Via attribute algorithm, using the function TRANSLATE, translate the values of the variable TXT and assign them to the help variable XTXT:

      XTXT = TRANSLATE(TXT)

    2. Now you can use XTXT for the definition of the variable NENN.

      NENN = '$D. $XTXT.'

    3. Use NENN for the Row Label.

    Result:

  • Example 4 - Translation of a variable: Translate text in the Row Label

    [Note] Note

    When using a variable in the form $VARIABLENNAME. always its internal value is returned.[a] However, if you want to work with the visible, translated value (in the Row Label, 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 attribute algorithms, which access the internal value by this in order to work with it.

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

    Under PARTproject -> tabbed page General -> Row Label, insert the following expression:

    $TXT(SRC=VALDESC).

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

    Row Label with use of "$Variablename."

    Row Label with use of "$Variablename."

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

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

    Row Label with the use of the function "$Variablename(SRC=VALDESC)."

    Row Label with the use of the function "$Variablename(SRC=VALDESC)."

    Result: Now the Row Label is also translated.

    Result: Now the Row Label is also translated.

    [Note] Note

    The function TRANSLATE ($VARIABLENNAME.) cannot directly be used under PARTproject -> tabbed page General -> Row Label. The alternate procedure is explained in example 3.



[53] $CADENAS/training/training.cip