---
title: Register localization resources
related:
  - https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization.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).

The administration interface reads localized strings from _.resx_ resource files that you register in the system. Register resource files to add admin UI translations, to localize the texts of your own customizations, or to change Xperience's default English strings. Each registration says which languages the file contains and which part of the system reads the strings.

## Register localized resources

Create and register _.resx_ resource files using the [conventional .NET approach](https://learn.microsoft.com/en-us/dotnet/core/extensions/create-resource-files).

1. Create a new .NET resource file in your custom assembly. The assembly must be [discoverable](https://docs.kentico.com/documentation/developers-and-admins/customization/integrate-custom-code.md#enable-class-discovery). Otherwise, the system ignores its registrations. The web project of your application is discoverable automatically.

2. Register the resource file using the `RegisterLocalizationResource` assembly attribute. The attribute has the following parameters:

   - The type of the class that encapsulates the resource file.
   - Optionally, the [localization target](#choose-the-localization-target). If not specified, the target defaults to `LocalizationTarget.Server`.
   - The culture codes of the languages the file contains. Use the culture codes of your [admin UI languages](https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization.md#configure-available-languages-for-users), and the `SystemContext.SYSTEM_CULTURE_NAME` constant (`en-us`) for English. See [Culture codes](https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization.md#culture-codes).

   ```csharp title="Register localization resources"
   using CMS.Base;
   using CMS.Localization;

   using MyProject.Resources;

   // Registers the default English strings
   [assembly: RegisterLocalizationResource(
       typeof(LocalizationClient),
       LocalizationTarget.Client,
       SystemContext.SYSTEM_CULTURE_NAME)]

   // Registers resources for additional languages
   [assembly: RegisterLocalizationResource(
       typeof(LocalizationClient),
       LocalizationTarget.Client,
       "cs-CZ")]
   [assembly: RegisterLocalizationResource(
       typeof(LocalizationClient),
       LocalizationTarget.Client,
       "de-DE")]

   namespace MyProject.Resources;

   // Class encapsulating the localization resource files
   /* Corresponding .resx files: LocalizationClient.resx, LocalizationClient.cs-CZ.resx,
      and LocalizationClient.de-DE.resx. */
   public class LocalizationClient { }
   ```

> **Info:** **Resource file placement**
>
> Name each _.resx_ file after its registration class and place it in the same folder as the class, for example, _LocalizationClient.cs-CZ.resx_ next to _LocalizationClient.cs_. The build derives filenames from the class, and the system finds them without any additional configuration.
>
> If you store the _.resx_ files elsewhere, configure the `LogicalName` property in the project's _.csproj_ file to map the files to the registration class. See the [TrainingGuides.Admin project](https://github.com/Kentico/xperience-by-kentico-training-guides/blob/finished/src/TrainingGuides.Admin/TrainingGuides.Admin.csproj) for an example.

> **Info:** **English resources for system and custom strings**
>
> English _.resx_ files are not required for Xperience's default system strings. The system uses built-in English resources automatically. Register English resources only for your own resource keys, or when changing the default English text. See [Default system culture](https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization.md#default-system-culture).

To confirm that the English registration loaded, run `dotnet run -- --kxp-export-localization-resources --export-path {path} --skip-confirmation` in the web project, exporting to a new, empty directory. Then check that `{path}/en-US/custom/localization.{target}.en-US.resx` exists for the target you registered and contains your resource keys. Strings registered under another culture code, such as `en`, or in an assembly that isn't discoverable, don't appear in the file.

## Choose the localization target

The localization target determines which part of the system reads the strings of a resource file. Register each file for the target that displays its strings. To use the same strings in several targets, add a registration for each target.

![Diagram of where the system uses the strings of each localization target. The following table lists the full information.](https://docs.kentico.com/docsassets/documentation/register-localization-resources/localization-targets.drawio.svg "Where the system uses the strings of each localization target")

| Target                       | Use for                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | How the system uses the strings                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LocalizationTarget.Server`  | Texts resolved in back-end code:<br>Strings retrieved using `ILocalizationService` in [custom admin code](https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization/localize-custom-admin-code.md#retrieve-strings-in-back-end-code), for example, in UI pages.<br>[Localization expressions](https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization/localize-custom-admin-code.md#localization-expressions) in field metadata, in editing components defined in code, and in [rich text editor configurations](https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization/localize-custom-admin-code.md#localize-rich-text-editor-configurations).<br>Texts of [builder components](https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization/localize-builder-components.md) that the system resolves on the server: names and descriptions of components, hints of personalization condition types, labels, explanation texts, tooltips, and inactive messages of editing components in properties classes, and strings retrieved using `IAdminBuildersLocalizationService` in Razor views.<br>The default target. | Resolved on the server for each request and sent as part of API responses.                                                                                                                                                                                                                                                                                                       |
| `LocalizationTarget.Client`  | Texts in [client-side admin code](https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization/localize-custom-admin-code.md#retrieve-strings-in-client-side-code), retrieved using the i18n library in React components.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Sent to the browser when the admin UI loads. The strings don't resolve in `ILocalizationService` or in localization expressions.                                                                                                                                                                                                                                                 |
| `LocalizationTarget.Builder` | All texts of [builder components](https://docs.kentico.com/documentation/developers-and-admins/customization/admin-ui-localization/localize-builder-components.md) in Page Builder, Form Builder, and Email Builder:<br>Texts that the system resolves on the server, the same as for `LocalizationTarget.Server`.<br>Strings retrieved using `localizationService.getString` in inline editor scripts. Only this target supports these strings.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Resolved on the server together with the `LocalizationTarget.Server` strings, and also sent to the builder scripts in the browser.<br>If both targets contain the same key, the `LocalizationTarget.Server` string applies on the server, while builder scripts use the `LocalizationTarget.Builder` string. Don't register the same key with different values for both targets. |
