|
||
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 value of the resource string with the specified key. Strings can be viewed and edited in Site Manager -> Development -> UI Cultures 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.
On the left, you can see an example that displays Hallo for German culture, Ciao for Italian and Hello for all other cultures (default value).
|
{$=Hello|de-de=Hallo|it-it=Ciao$} |
See also: Development -> Macro expressions
Fields in the Kentico CMS interface that contain the display names or descriptions of objects provide a more 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 from the given section of the UI.
Please note that these actions are only available for websites that are multilingual, i.e. those that have more than one culture assigned in Site Manager -> Sites -> edit () site -> Cultures. Because this feature provides a way to edit any resource string, it is only allowed for users designated as global administrators.
To add a resource string to a field where this functionality is supported, click the Localize () button.
This opens a dialog where a new string can be created, or an existing one can be selected for the field.
Next, the text of the resource string may be edited for specific cultures. All cultures specified on the Site Manager -> Development -> UI cultures -> All cultures tab are available. If the Show only site cultures box is checked, only cultures that are assigned to the currently active site will be visible. The Show default culture option can be used to ensure that the default UI culture configured for your installation of Kentico CMS is always displayed.
Please keep in mind that modifying the resource string assigned to a particular field will also affect all other occurrences of the same string.
When finished, click OK to confirm any changes to the resource string.
It is necessary to save the form using the OK button to confirm that the string should be inserted into the field (some forms may use a Save button at the top of the page instead). The field will now be localized and its value will be displayed according to the current culture settings.
The text of the resource string can be edited at any time by using the Localize other languages () button. If you wish to remove the localization string from a field, click the Remove localization () action.
|
Please note
Resource strings created using localization dialogs are always stored in the database. The dialogs cannot be used to interact with strings contained in resource files (.resx) under the CMSResources folder. |