Is this really the version you are looking for? Kentico 8 documentation is no longer updated. Use the switch in the header to choose your Kentico version.

Localizing text fields

Fields in the Kentico administration interface that contain the Display names or Descriptions of objects provide a user friendly way to handle localization. This is achieved using action buttons and dialogs that allow you to insert resource strings and edit their text and translations directly.

To add a resource string to a field where localizaton is supported:

  1. Place the cursor into the field and click the Localize () button.

    Adding localization to a Display name field
  2. Choose from the two options:
    • Create new resource string - directly creates a new resource string. The identifier (key) of the new string contains a special prefix (custom. by default).
    • Use existing resource string - allows you to select an existing resource string. You can choose only strings that are stored in the database. Resource strings contained in .resx files cannot be accessed this way.

  3. Type the resource key name into the displayed dialog or choose an existing resource key.
  4. Click Save & Close.
  5. Edit the text of the resource string for individual cultures.
    • You can use machine translation services to assist with the translation (if there are any configured for your application).
    • If you do not see the desired language, use the Show translation for radio buttons to change the category of cultures.
    • Please keep in mind that modifying an existing resource string also affects all other occurrences of the same string.

    Editing the text of a resource string in the Localize string dialog
  6. Click Save & Close to confirm any changes made to the resource string.
  7. Save the editing form to confirm the insertion of the string into the field.

The field is now localized and displays a value according to the current culture settings. You can edit the text of the resource string at any time by clicking Localize other languages () or directly in the form.

To remove the localization string from a field, click Remove localization ().

Note: Resource strings created using localization dialogs are always stored in the database. You can use the dialogs to insert the keys of strings stored in resource files (.resx), but the system creates a matching string in the database when you make any changes of the string text (translations).


Localizing text fields using macro expressions

If you need to supply a localized value into a field or text area where localization expressions are supported, you can use expressions in the following formats:

Format

Description

Sample Value

Basic format:

{$key$}

Displays the value of the resource string with the specified key. Strings can be viewed and edited in the Localization application or in the .resx files under the CMSResources folder.

{$myform.firstname$}

In-place localization:

{$=default_string|culture_code=translation|culture_code=translation|etc.$}

Displays the strings defined in the expression.


{$=Hello|de-de=Hallo|it-it=Ciao$}

See also: Macro expressions