---
title: Working with resource strings
related:
  - https://docs.kentico.com/13/multilingual-websites/translating-content-using-external-services/translating-localization-strings-using-machine-translation.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Resource strings store the text displayed in the Xperience administration interface and on the live site.

- For the administration application, the system's default resource strings are stored in the **cms.resx** file located in the project's **CMSResources** folder. See: [Modifying the default UI strings used by the administration interface](#modifying-the-default-ui-strings-used-by-the-administration-interface)
- For the live site application, the default resource string files used by the system are stored as embedded resources in application assemblies (delivered via the NuGet [integration packages](https://docs.kentico.com/13/developing-websites/starting-with-mvc-development/installing-xperience-integration-packages.md)). See: [Modifying the default UI strings on the live site](#modifying-the-default-ui-strings-on-the-live-site)
- You can define custom resource strings for use on the live site or in the administration interface. See: [Adding your own strings](#adding-your-own-strings)
- You can define component-specific resource strings to localize [page builder](https://docs.kentico.com/13/developing-websites/page-builder-development.md) and [form builder](https://docs.kentico.com/13/developing-websites/form-builder-development.md) components. See: [Localizing builder components](https://docs.kentico.com/13/multilingual-websites/setting-up-a-multilingual-user-interface/localizing-builder-components.md)
- You can edit the resource strings that the system stores in the database in the **Localization** application on the **Resource strings** tab.

> **Info:** **Resource string priority**
>
> When loading resource strings, the system uses the following priority:
>
> 1. database (Localization application) – highest priority
> 2. site and component specific resx files
> 3. resx files of custom modules
> 4. custom.resx – detected based on a naming convention. Not present by default.
> 5. cms.resx
>
> If there are duplicate strings with the same key in all five sources, the system uses the one stored in the database.
>
> To change the priorities, you can add the following key to your project's configuration file:
>
> ```html
>
> <add key="CMSUseSQLResourceManagerAsPrimary" value="false" />
>
> ```
>
> When this key is added, the priorities are as follows:
>
> 1. site and component specific resx files
> 2. resx files of custom modules
> 3. custom.resx – detected based on a naming convention. Not present by default.
> 4. cms.resx
> 5. database

## Modifying the default UI strings used by the administration interface

If you want to modify text in the Xperience administration interface, use one of the following options:

- Override resource strings in the **Localization** application.
- Create a **cms.resx** file in your administration project's **CMSResources** folder and store your strings in this file.

  - The file's content must have a valid XML structure for the [.resx file format](https://docs.microsoft.com/en-us/previous-versions/ekyft91f\(v=vs.100\)), including header information. You can copy the general structure from the default **cms.resx** file.
  - To customize strings in non-English resource files, your custom file must use a name in format **cms..resx** (for example, **cms.fr-fr.resx** for French).

In both cases, the keys used to identify the strings must be the same as in the default **cms.resx** file.

## Modifying the default UI strings on the live site

The default resource string files used by the system are stored as embedded resources in application assemblies (delivered via the NuGet [integration packages](https://docs.kentico.com/13/developing-websites/starting-with-mvc-development/installing-xperience-integration-packages.md)). The live site localization strings are split into the following files:

- _KenticoResources.resx_ – general strings used by the Xperience integration.
- _Kentico.Builder.resx_ – strings shared by both the form and page builder.
- _Kentico.PageBuilder.resx_ – strings for the page builder UI.
- _Kentico.FormBuilder.resx_ – strings for default [form components](https://docs.kentico.com/13/developing-websites/form-builder-development/reference-system-form-components.md) and the form builder UI.
- _Kentico.Components.resx_ – strings for default [selector components](https://docs.kentico.com/13/developing-websites/page-builder-development/selectors-for-page-builder-components.md) and widgets.

If you need access to these strings for the purpose of localization, contact us at <partners@kentico.com> or <support@kentico.com>.

To modify or translate these strings, use the following process:

1. Create the **\~/App\_Data/Global/Resources** folder in your live site application (if necessary).
2. Create a file with a name identical to one of the resx files listed above in the folder.

   - For non-English resource files, create a subfolder matching the culture code of the target culture. For example: _\~/App\_Data/Global/Resources/es-es_
3. Place the localized or modified strings into the file. The keys used to identify the strings must match those used the original file.
   - The system prioritizes strings stored in these files over the default ones.

The application now prioritizes resource strings located under _\~/App\_Data/Global/Resources_.

## Accessing the Localization application

Editing of resource strings in the **Localization** application is only possible for two types of users:

- Users with the Global administrator [privilege level](https://docs.kentico.com/13/managing-users/user-management.md)
- Users who belong to [roles](https://docs.kentico.com/13/managing-users/role-management.md) with the **Localize strings** [permission](https://docs.kentico.com/13/managing-users/configuring-permissions.md) for the **Localization** module

> **Note:** **Note**: The _Localize strings_ permission allows users to edit or override all global resource strings. You cannot use the permission model to restrict access to a certain subset of resource strings, for example on instances containing multiple independent websites.

## Adding your own strings

If you need to translate custom strings used on your website such as form labels, display names of objects or other static text into other languages, you can create a new resource string:

1. Open the **Localization** application.
2. Choose the default culture in the **Culture** selector.
3. Click **New string**.
4. Type the name of the resource string into the **Key** field.
5. Typethe text for the key into the **Translation** field of the corresponding language.
6. Click **Save**.

A new string in the default culture is now displayed in the list.

> **Tip:** You can also create new resource strings directly when editing text fields in the administration interface. See [Localizing text fields](https://docs.kentico.com/13/multilingual-websites/setting-up-a-multilingual-user-interface/localizing-text-fields.md).

<!-- dev-model:core start -->

**ASP.NET Core development model.** Applies only when building with ASP.NET Core. If this page also covers MVC 5, that version is in its own block.

> **Note:** **Xperience Localization application**
>
> Text values used within ASP.NET Core live site applications must be stored within localized resource files. For this purpose, you cannot use the **Localization** application of the Xperience administration interface (i.e., resource strings stored in the database).
>
> Such strings can only be placed into fields in the administration using localization macros.

<!-- dev-model:core end -->

## Translating resource strings into other languages

1. Open the **Localization** application.
2. Edit () the resource string.
3. If you do not see the desired language, use the **Show translation for** radio buttons to change the category of cultures.
4. Translate the string into the desired language in the corresponding **Translation** field.

   ![Translating a resource string](https://docs.kentico.com/docsassets/13/working-with-resource-strings/Translating_Strings.png "Translating a resource string")
5. Click **Save**.

The resource string and its translation are now created and stored in the database.

## Retrieving resource strings via API

<!-- dev-model:mvc start -->

**MVC 5 development model.** Applies only when building with ASP.NET MVC 5. If this page also covers ASP.NET Core, that version is in its own block.

If you need to retrieve the value of a resource string in your custom code, use **CMS.Helpers.ResHelper**.**GetString**. The method retrieves a localized string associated with the given resource string name. For example:

```csharp

using CMS.Helpers;

...

// Loads the value of the 'stringKey' resource string (in the default culture)
string localizedResult = ResHelper.GetString("stringKey");

```

<!-- dev-model:mvc end -->

<!-- dev-model:core start -->

**ASP.NET Core development model.** Applies only when building with ASP.NET Core. If this page also covers MVC 5, that version is in its own block.

If you need to retrieve the value of a resource string in your custom code, use Localizer implementations according to the practices described in [Microsoft's localization documentation](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization).

<!-- dev-model:core end -->
