OptivaServerUICultureName

You can use the OptivaServerUICultureName property in Optiva workflows to access the servers current UI culture name. The property provides access to the server property: System.Threading.Thread.CurrentThread.CurrentUICulture.Name.

Note: This identifies the users culture for the current Optiva session, For example, language and regional settings.

When to use

You can use this function to:

  • Display workflow messages in the user's language based on culture settings.
  • Format dates, numbers, and currency according to the user's culture for reports and exports.

Syntax

string OptivaServerUICultureName { get; set; }

Access

  • Get: Retrieve the current server UI culture name.
  • Set: Set the server UI culture name.

Return Value

Returns a culture code string, such as:

  • "EN-US" - English (United States)
  • "ES-ES" - Spanish (Spain)
  • "FR-FR" - French (France)
  • "DE-DE" - German (Germany)
  • "PT-BR" - Portuguese (Brazil)
  • "ZH-CN" - Chinese (Simplified, China)

Prerequisites

The culture is specific to the current user session.

Examples

Example 1
Using Context.SessionInfo.Language.
string sLanguage = Context.SessionInfo.Language;
string msg;
int rtn = GetMessageText("FORMULACALCFAILED", out msg, sLanguage);
MessageList("Language", sLanguage, "Message Code", msg);
Description
To display the message text for FormulaCalcFailed in the local browser language.
Example 2
Using OptivaServerUICultureName.
string sLanguage = OptivaServerUICultureName;
string msg;
int rtn = GetMessageText("FORMULACALCFAILED", out msg, sLanguage);
MessageList("Language", sLanguage, "Message Code", msg);
Description
If Context.SessionInfo.Language is not returning the resulting language that you want, you ca use OptivaServerUICultureName.