Freigeben über


IUpdateServer.PreferredCulture Property

 

Applies To: Windows Server Update Services

Gets or sets the culture code that you want the WSUS server to use when returning strings.

Namespace:   Microsoft.UpdateServices.Administration
Assembly:  Microsoft.UpdateServices.Administration (in Microsoft.UpdateServices.Administration.dll)

Syntax

string PreferredCulture { get; set; }
property String^ PreferredCulture {
    String^ get();
    void set(String^ value);
}
abstract PreferredCulture : string with get, set
Property PreferredCulture As String

Property Value

Type: System.String

The culture code that you want the WSUS server to use when returning strings, for example, "en" for English or "pt-br" for Portuguese (Brazil). This is generally the same as the current UI culture. If you do not set this property, WSUS uses English ("en") as the preferred culture when returning strings. Note also that inner exceptions will be returned not in the language specified by PreferredCulture but in the language specified by CurrentUICulture.

Exceptions

Exception

Condition

ArgumentOutOfRangeException

WSUS does not support the given culture code. For a list of valid values, see SupportedUpdateLanguages.

ArgumentNullException

You cannot specify a null value.

Remarks

This value should be set to the current UI culture for the caller. Some strings may be returned in the UI culture for the calling thread. You should set this property before calling any of the IUpdateServer methods. The culture code is not persisted; you must set the language code each time you get a new IUpdateServer instance. The culture code applies to all other objects that IUpdateServer returns.

This property tells the WSUS server the culture to use when returning strings. The preferred culture string follows the format that is specified in RFC1766. WSUS supports a subset of the language and culture codes that are specified in ISO 639 and ISO 3166, respectively. To determine if WSUS supports a preferred culture value, call SupportedUpdateLanguages.

Strings that come from user input are not localized. All other strings should be localized. For example, the metadata for updates is localized. When you specify a preferred culture, if an update has localized metadata in that language, the WSUS server returns the information in the specified language. If not, the server returns the strings in English.

This property stores the value in lowercase. If you set the property to pt-BR, WSUS returns the property value as pt-br.

Examples

For an example that sets the preferred culture, see Using the Windows Server Update Services 3.0 Class Library.

See Also

IUpdateServer Interface
Microsoft.UpdateServices.Administration Namespace

Return to top