# ResourceProvider.GetText Method

> Gets the text that is associated with an item and specified by the identifier parameter. Such an identifier can be the string conversion of an enumeration that is associated with an item (such as RibbonFormattingTab.RibbonItem.TXITEM_Paste). By default CultureInfo.CurrentUiCulture determines the language of the text resources. If no resource translation is provided, that corresponds to the current ui culture or the value of the culture parameter, the returned text is based on the English resources.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 27.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > ResourceProvider.GetText Method
- **871 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/gettext-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/gettext-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/gettext-method/llms-full.txt

---

### Description

Gets the text that is associated with an item and specified by the identifier parameter. Such an identifier can be the string conversion of an enumeration that is associated with an item (such as [RibbonFormattingTab.RibbonItem.TXITEM\_Paste](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/ribbonformattingtab/ribbonitem-enumeration/llms-full.txt)). By default CultureInfo.CurrentUiCulture determines the language of the text resources. If no resource translation is provided, that corresponds to the current ui culture or the value of the culture parameter, the returned text is based on the English resources.

### Syntax

#### GetText(string)

Gets the text that is associated with the specified item identifier.

```csharp
public static string GetText(string identifier);
```

```vbnet
Public Shared Function GetText(identifier As String) As String
```

| Parameter | Description |
|---|---|
| identifier | The identifier of the item that is associated with the requested text. |

#### GetText(string, CultureInfo)

Gets the text that is associated with the specified item identifier in the specified language.

```csharp
public static string GetText(string identifier, CultureInfo culture);
```

```vbnet
Public Shared Function GetText(identifier As String, culture As CultureInfo) As String
```

| Parameter | Description |
|---|---|
| identifier | The identifier of the item that is associated with the requested text. |
| culture | Specifies the language in which the text is returned. |

### Return Value

The text that is assigned to the item. If no text is associated with the source, the method returns an empty string.

### Examples

The following example retrieves text from the resource provider.

```csharp
var result = TXTextControl.WPF.ResourceProvider.GetText("Quarterly report", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
Console.WriteLine($"Get Text result: {result}");
```

```vbnet
Dim result = TXTextControl.WPF.ResourceProvider.GetText("Quarterly report", System.Globalization.CultureInfo.GetCultureInfo("en-US"))
Console.WriteLine($"Get Text result: {result}")
```

---

## Nearby

- **Previous:** [ResourceProvider.GetSmallIcon Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/getsmallicon-method/llms-full.txt)
- **Next:** [ResourceProvider.GetToolTipDescription Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/gettooltipdescription-method/llms-full.txt)
