@LanguagePreference (Formula Language)

Returns user's specified preferred language setting.

Note: This function is new with Release 5.

Syntax

@LanguagePreference ( [ key ] )

Parameters

[ key ]

Keyword. Specify a category for which you would like to get the preferred language. The following categories are available:

[REGION]

Returns preferred language for region.

[CONTENT]

Returns preferred language for database contents.

[ALTERNATENAME]

Returns preferred language for alternate name.

Return value

preferredlanguage

Text or Text list. Language and country code for user's preferred setting. [REGION] language is set as the default. If @LanguagePreference cannot find the language setting for the specified category, it returns the language for [REGION].

Usage

@LanguagePreference is used to implement mechanisms for handling language-dependent features. A database that is designed to store data in multiple languages can select the language in which the data should be published for each user by using @LanguagePreference[Content].

@LanguagePreference supports the Web browser client. When the browser client calls @LanguagePreference, it returns a list of languages specified in the Web browser. This returned list is normalized based on the key parameter of the @function.

Examples

  1. The following example returns "fr" if your region language setting is French.
    @LanguagePreference([REGION])
  2. The following example returns "en" if you call this function from the Web client and your Web browser's accept language is "English(United States)."
    @LanguagePreference([ALTERNATENAME])