> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Translate strings

> How to translate strings

Translate strings from resource ID to translated value using the DCF globalization utility.

## Config

The **Resource Manager** handles reading the resource strings from various sources. The sources are specified in the config file:

```XML theme={null}
<SuperOffice>
  ...
  <Client>
    <Application name="WebClient" instance="Web" />
    <Globalization>
      <ResourceProviders>
        <add name="DllFile" rank="20" assemblyname="SuperOffice.DCF" objecttype="SuperOffice.Globalization.ResourceDllProvider"
             params="SuperOffice.Web.Globalization.ResourceStrings;SuperOffice.Web.Globalization" />
        <add name="FieldLabelFromDB" rank="10" assemblyname="SuperOffice.DCF" objecttype="SuperOffice.Globalization.FieldLabelProvider" />
        <add name="ResxFile" rank="30" assemblyname="SuperOffice.DCF" objecttype="SuperOffice.Globalization.ResXmlFileProvider" params=".\TestXmlResources" />
      </ResourceProviders>
    </Globalization>
  </Client>
</SuperOffice>
```

This specifies that the ResourceManager should first load the `FieldLabel` provider, which reads from the database.

Next, the resource DLL **SuperOffice.Web.Globalization** is loaded using the `ResourceDllProvider`, and the strings in the bundle `SuperOffice.Web.Globalization.ResourceStrings` are read in.

Finally, the XML text file *TestXmlResources.resx* is loaded using the `ResXml` file provider.

## Resx file

```XML theme={null}
<?xml version="1.0" encoding="utf-8"?>
<root>
  <data name="SR_FOOBAR">
    <value>This is funked up beyond all recognition.</value>
  </data>
</root>
```

## Translate

Assuming the resource file contains a string ID `SR_FOOBAR`, then the program can get the translated value using:

```csharp theme={null}
string resid = "SR_FOOBAR";
string res_out = SuperOffice.Globalization.ResourceManager.GetString(resid);
Console.Out.WriteLine("{0}={1}", resid, res_out);
```

<Note>
  The resource manager also handles resource names that are decorated with square brackets for you. This is the same as the above:
</Note>

```csharp theme={null}
string resid = "[SR_FOOBAR]";
string res_out = SuperOffice.Globalization.ResourceManager.GetString(resid);
Console.Out.WriteLine("{0}={1}", resid, res_out);
```


## Related topics

- [NSAIAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSAIAgent.md)
- [SuperOffice.WebApi.Agents.AIAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.AIAgent.md)
- [SuperOffice.WebApi.Agents.IAIAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IAIAgent.md)
- [Translate](/en/api/reference/restful/agent/ai_agent/translate.md)
- [Translate Entity](/en/api/reference/restful/agent/ai_agent/translate-entity.md)
- [SuperOffice.WebApi.Data.AI TranslateRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.AI_TranslateRequest.md)
