# OpcArgumentGlobalization Members

> Reference: Provides mechanisms to control the localization of data and information used by an argument.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcArgumentGlobalization</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

## Properties

### Cultures

Gets a sequence of [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo) objects associated with the resources maintained by the current [OpcArgumentGlobalization](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/).

<div class="api-signature" data-lang="csharp">

```csharp
public IEnumerable<CultureInfo> Cultures { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Cultures As IEnumerable(Of CultureInfo)
```

</div>

**Property value**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo)&gt;

An [IEnumerable&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of unique [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo) objects.

### Locales

Gets a sequence of [string](https://learn.microsoft.com/dotnet/api/system.string) objects representing the [Name](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.name) of the [Cultures](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/members#cultures) associated with the resources maintained by the current [OpcArgumentGlobalization](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/).

<div class="api-signature" data-lang="csharp">

```csharp
public IEnumerable<string> Locales { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Locales As IEnumerable(Of String)
```

</div>

**Property value**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[String](https://learn.microsoft.com/dotnet/api/system.string)&gt;

An [IEnumerable&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of unique [string](https://learn.microsoft.com/dotnet/api/system.string) objects.

### Values

Gets a sequence of [string](https://learn.microsoft.com/dotnet/api/system.string) objects representing the resources associated with the [Cultures](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/members#cultures) maintained by the current [OpcArgumentGlobalization](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/).

<div class="api-signature" data-lang="csharp">

```csharp
public IEnumerable<string> Values { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Values As IEnumerable(Of String)
```

</div>

**Property value**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[String](https://learn.microsoft.com/dotnet/api/system.string)&gt;

An [IEnumerable&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of [string](https://learn.microsoft.com/dotnet/api/system.string) objects.

## Methods

### Add

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [Add(string, string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/members#add-system-string-system-string) | Adds or overrides the specified resource `value` associated with the culture identified by `cultureName`. |
| [Add(CultureInfo, string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/members#add-system-globalization-cultureinfo-system-string) | Adds or overrides the specified resource `value` associated with the `culture` specified. |

#### Add(string, string)

Adds or overrides the specified resource `value` associated with the culture identified by `cultureName`.

<div class="api-signature" data-lang="csharp">

```csharp
public void Add(string cultureName, string value)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Add(cultureName As String, value As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `cultureName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [Name](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.name) of a well known non-neutral [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo). |
| `value` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [string](https://learn.microsoft.com/dotnet/api/system.string) value of the resource. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `cultureName` is an empty string or the [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo) referred to by `cultureName` is a neutral culture. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `cultureName` is a null reference (Nothing in Visual Basic). |
| [CultureNotFoundException](https://learn.microsoft.com/dotnet/api/system.globalization.culturenotfoundexception) | The culture specified by `cultureName` does not refer to a well known culture. |

#### Add(CultureInfo, string)

Adds or overrides the specified resource `value` associated with the `culture` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public void Add(CultureInfo culture, string value)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Add(culture As CultureInfo, value As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `culture` | [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo) | The non-neutral [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo). |
| `value` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [string](https://learn.microsoft.com/dotnet/api/system.string) value of the resource. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `culture` is a neutral culture. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `culture` is a null reference (Nothing in Visual Basic). |

### Clear

Removes all resources associated with the [Cultures](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/members#cultures).

<div class="api-signature" data-lang="csharp">

```csharp
public void Clear()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Clear()
```

</div>

### Remove

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [Remove(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/members#remove-system-string) | Removes the resource associated with the culture identified by `cultureName`. |
| [Remove(CultureInfo)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/members#remove-system-globalization-cultureinfo) | Removes the resource associated with the `culture` specified. |

#### Remove(string)

Removes the resource associated with the culture identified by `cultureName`.

<div class="api-signature" data-lang="csharp">

```csharp
public void Remove(string cultureName)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Remove(cultureName As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `cultureName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [Name](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.name) of a well known non-neutral [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo). |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `cultureName` is an empty string or the [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo) referred to by `cultureName` is a neutral culture. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `cultureName` is a null reference (Nothing in Visual Basic). |
| [CultureNotFoundException](https://learn.microsoft.com/dotnet/api/system.globalization.culturenotfoundexception) | The culture specified by `cultureName` does not refer to a well known culture. |

#### Remove(CultureInfo)

Removes the resource associated with the `culture` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public void Remove(CultureInfo culture)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Remove(culture As CultureInfo)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `culture` | [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo) | The non-neutral [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo). |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `culture` is a neutral culture. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `culture` is a null reference (Nothing in Visual Basic). |

### Translate

Translates the `text` into the preferred locales of the `context` using the resources maintained by the current [OpcArgumentGlobalization](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcargumentglobalization/).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcText Translate(OpcContext context, OpcText text)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function Translate(context As OpcContext, text As OpcText) As OpcText
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) which provides the preferred locales. |
| `text` | [OpcText](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctext/) | The [OpcText](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctext/) to translate. |

**Returns**

[OpcText](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctext/)

The resource of the first preferred locale which has a resource; otherwise a resource of the same language as a preferred locale; otherwise the `text`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `context` or `text` is a null reference (Nothing in Visual Basic). |
| [CultureNotFoundException](https://learn.microsoft.com/dotnet/api/system.globalization.culturenotfoundexception) | A preferred locale of the `context` does not refer to a well known culture. |

**Remarks**

If the first preferred locale is the locale of the `text`, the `text` is returned unchanged.
