# Localization

> Set the Document Editor's UI language and culture with UICulture and Culture, and build satellite assemblies for more languages with the Resource Kit.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > Document Editor > Ribbon and UI > Localization
- **2731 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/ribbon-ui/localization/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/ribbon-ui/localization/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/ribbon-ui/localization/llms-full.txt

---

Users who work in a language other than English need the user interface of the Document Editor in their language and values such as dates in the format of their culture. You set both cultures in the ASP.NET Core view and in the other frontends, read them from JavaScript and find out which languages are available.

The examples change the view of the [ASP.NET Core](https://docs.textcontrol.com/tx-text-control-dotnet-server/getting-started/document-editor/aspnet-core/llms-full.txt) tutorial. The language of the document text, which spell checking uses, is a formatting attribute of the text and is described in [Spell Checking](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/spell-checking/#set-the-language-of-text).

### Culture and UI Culture

The editor has two culture settings:

| Setting | Affects | Example |
|---|---|---|
| UI culture | The language of the string resources: the texts of the ribbon, the dialog boxes and the messages | `"de-DE"` shows a German user interface |
| Culture | The formats of values such as dates and times, and the unit of the rulers when their unit is `Auto` | `"de-DE"` formats dates the German way |

The string resources come from the server. The editor raises the `ribbonTabsLoaded` event when the content of the ribbon has been loaded and the string resources have been applied, so code that changes texts or elements of the ribbon waits for this event; see [Events](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/events/#events-during-initialization).

English and German string resources are built in. If the view sets no culture, the editor uses the language of the browser to select the string resources and the units of measurement.

### Set the Cultures in the ASP.NET Core View

[TextControlSettings.UICulture](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web-mvc/textcontrolsettings/uiculture-property/llms-full.txt) and [TextControlSettings.Culture](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web-mvc/textcontrolsettings/culture-property/llms-full.txt) set the cultures when the view is rendered. The following view shows the editor with a German user interface and German formats. Replace the content of *Views/Home/Index.cshtml*:

```cshtml
@using TXTextControl.Web.MVC

@{
    var sDocument = "<html><body><p>Welcome to <strong>Text Control</strong></p></body></html>";
}

@Html.TXTextControl().TextControl(settings => {
    settings.UserNames = new string[] { "Tim Typer" };
    settings.UICulture = System.Globalization.CultureInfo.GetCultureInfo("de-DE");
    settings.Culture = System.Globalization.CultureInfo.GetCultureInfo("de-DE");
}).LoadText(sDocument, TXTextControl.Web.StringStreamType.HTMLFormat).Render()

<script>
    TXTextControl.addEventListener("textControlLoaded", function () {
        var cultures = TXTextControl.getCultures();
        console.log("Culture: " + cultures.culture + ", UI culture: " + cultures.uiCulture);
    });
</script>
```

The code works as follows:

- Both properties take a `System.Globalization.CultureInfo` object, which `CultureInfo.GetCultureInfo` returns for a culture name such as `"de-DE"`.
- `UICulture` selects the German string resources, so the ribbon and the dialog boxes are shown in German.
- `Culture` sets the formats of dates and times and the unit of the rulers.
- [TXTextControl.getCultures](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getcultures-method/llms-full.txt) returns a [CultureSettings](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/culturesettings/llms-full.txt) object directly, without a callback. Its [culture](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/culturesettings/culture-property/llms-full.txt) and [uiCulture](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/culturesettings/uiculture-property/llms-full.txt) contain the culture names the editor uses.

Run the application: the ribbon tabs are labeled in German, and the browser console shows "Culture: de-DE, UI culture: de-DE". The rulers switch to centimeters, the unit of the German culture:

![Document Editor with a German user interface: the ribbon tabs Start, Einfügen, Seitenlayout, Seriendruck, Ansicht, Referenzen, Überprüfen, Berechtigungen and Formularfelder, the button Feldnavigation and rulers in centimeters](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-server/german-user-interface.cc5b87e6.webp)

The picture shows a plain JavaScript page that sets both cultures to `de-DE` in the `init` settings, as in the next section.

The JavaScript API can read the cultures, but it has no method that changes them. Set them when the editor is created.

### Set the Cultures in Other Frontends

- **Plain JavaScript page.** Pass [culture](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/documenteditorsettings/culture-property/llms-full.txt) and [uiCulture](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/documenteditorsettings/uiculture-property/llms-full.txt) of [DocumentEditorSettings](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/documenteditorsettings/llms-full.txt) as `editorSettings` to [TXTextControl.init](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/init-method/llms-full.txt). Both are strings.
- **Angular.** The `tx-document-editor` component has the attributes `culture` and `uiCulture`.
- **React.** The `DocumentEditor` component has the properties `culture` and `uiCulture`.

The page of the [JavaScript](https://docs.textcontrol.com/tx-text-control-dotnet-server/getting-started/document-editor/javascript/llms-full.txt) tutorial creates the editor with German cultures like this:

```javascript
TXTextControl.init({
  containerID: "txDocumentEditor",
  webSocketURL: "wss://localhost:7118/api/TXWebSocket",
  editorSettings: {
    culture: "de-DE",
    uiCulture: "de-DE"
  }
});
```

In the [Angular](https://docs.textcontrol.com/tx-text-control-dotnet-server/getting-started/document-editor/angular/llms-full.txt) tutorial, the attributes are added to the component:

```html
<tx-document-editor
  width="1000px"
  height="500px"
  webSocketURL="wss://localhost:7118/api/TXWebSocket"
  culture="de-DE"
  uiCulture="de-DE">
</tx-document-editor>
```

The [React](https://docs.textcontrol.com/tx-text-control-dotnet-server/getting-started/document-editor/react/llms-full.txt) tutorial lists the properties of its component in the same way.

### Other Languages

Languages other than English and German need translated string resources. English and German are built in and can't be changed; every other language comes from a satellite assembly, the .NET mechanism for localized resources, which you build with the Resource Kit of TX Text Control. Resources are selected by culture: a French satellite assembly is used only when the UI culture is French, and the editor then shows the translated texts.

#### The Files of the Resource Kit

The Resource Kit is the *ResourceKit* folder of the TX Text Control installation directory, which the Windows setup creates. The version 34.0 Resource Kit contains these files:

| File | Contents |
|---|---|
| *TextControl.resx* | All built-in texts of TX Text Control, such as the dialog boxes, the messages and the ribbon, as XML; every text is the content of a `value` element |
| *DocumentServer.resx*, *TXDrawing.resx*, *TXBarcode.resx*, *TXTextControl.Web.Server.Process.resx* | The texts of the other assemblies, translated the same way |
| *buildres.bat* | The batch file that builds the satellite assemblies with the .NET Framework SDK tools `resgen`, `al` and `sn` |
| *txtextcontrol.public.snk* | The public key of TX Text Control, which the build needs |

#### Build a Satellite Assembly

1. Install the .NET Framework SDK, whose tools *buildres.bat* calls.
2. Translate the texts in the `value` elements of *TextControl.resx*, and of the other *.resx* files if their texts appear in your application. The blog article below changes the label of the **Reporting** tab, the resource `RibbonReportingTab`, to "Rapports".
3. Open a command prompt in which the SDK tools can be called, such as the Developer Command Prompt for Visual Studio that the blog article uses, change to the *ResourceKit* folder and run the batch file with the two-letter ISO 639 code of the language, for example `fr` for French:

    ```bash
    buildres fr
    ```

    It builds *txtextcontrol.resources.dll* from *TextControl.resx*, and *txdocumentserver.resources.dll*, *txdrawing.resources.dll*, *txbarcode.resources.dll* and *txtextcontrol.web.server.process.resources.dll* from the other files.
4. Create a subfolder named after the language code, such as *fr*, in the folder of the application that contains the TX Text Control assemblies, and copy the satellite assemblies into it.
5. Set the UI culture of the editor to the language, for example `fr-FR`, as described above.

The Resource Kit names its satellite assemblies after the assemblies of the .NET Framework. The packages of the cross-platform Core engine ship their German resources under other names: `TXTextControl.TextControl.Core.SDK` has *de/TXTextControl.Core.resources.dll* and *de/TXDocumentServer.Core.resources.dll*, and `TXTextControl.Web.DocumentEditor.Backend` has *de/TXTextControl.Web.Server.Core.Process.resources.dll*. The Text Control documentation doesn't describe how a Resource Kit build is used with the Core backend of an ASP.NET Core application; ask the Text Control support before you rely on it there.

The registry entries that the Resource Kit documentation adds for the strong-name verification of these assemblies apply to .NET Framework applications only.

The blog article [Changing the Language in the Angular Document Editor Using the Resource Kit](https://www.textcontrol.com/blog/2025/03/05/changing-the-language-in-the-angular-document-editor-using-the-resource-kit/) translates the label of the **Reporting** tab into French and sets `uiCulture` and `culture` to `fr-FR`. It was written for version 32.0, whose Document Editor backend was a Windows service. Its installation steps, a folder in the TX Text Control installation directory and entries in the Windows registry, belong to that backend. Since version 33.0, the backend of an ASP.NET Core application is a cross-platform process that your application starts, as described in [Architecture](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/architecture/llms-full.txt).

### Next Steps

- [Ribbon](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/ribbon-ui/ribbon/llms-full.txt): change the ribbon whose texts the UI culture sets.
- [Spell Checking](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/spell-checking/llms-full.txt): set the language of the document text.
- [Viewing and Printing](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/viewing-printing/llms-full.txt): set the unit of the rulers.

---

## Nearby

- **Previous:** [Custom Tabs](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/ribbon-ui/custom-tabs/llms-full.txt)
- **Next:** [JavaScript API](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/javascript-api/llms-full.txt)
