FaultReason.GetMatchingTranslation Method

Definition

Gets the fault description in a specific language.

Overloads

GetMatchingTranslation()

Gets the fault description in the language used by the current thread.

GetMatchingTranslation(CultureInfo)

Gets the fault description in the specified language.

GetMatchingTranslation()

Source:
FaultReason.cs
Source:
FaultReason.cs

Gets the fault description in the language used by the current thread.

C#
public System.ServiceModel.FaultReasonText GetMatchingTranslation();

Returns

A FaultReasonText object that contains the fault description.

Remarks

A translation is always returned.

  • If only one translation exists, it is returned.

  • If there is an exact match for a CultureInfo.CurrentCulture, that is returned.

  • If there is a translation for a parent language of CultureInfo.CurrentCulture, that is returned.

  • Otherwise, the first translation in the set is returned.

Applies to

.NET 10 (package-provided) a ďalšie verzie
Produkt Verzie
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0

GetMatchingTranslation(CultureInfo)

Source:
FaultReason.cs
Source:
FaultReason.cs

Gets the fault description in the specified language.

C#
public System.ServiceModel.FaultReasonText GetMatchingTranslation(System.Globalization.CultureInfo cultureInfo);

Parameters

cultureInfo
CultureInfo

A CultureInfo object that specifies the language of the fault description.

Returns

The fault text in the specified language.

Exceptions

Remarks

A translation is always returned.

Applies to

.NET 10 (package-provided) a ďalšie verzie
Produkt Verzie
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0