.setLanguage()

Previous Next

Sets the current language. This is the language that is sent to the Rules Service on every request.

Also translates all the possible strings in the DOM for which it has a translation.

Syntax

$.udb.ui.setLanguage( { language | language, $target } )

 

You must pass a single parameter which is either language by itself or an expression with $target.

Language is the language code defined in USoft Definer, which is preferably an ISO 639-1 language code such as "en" or "nl".

The optional $target has a required first character which is the '$' symbol. It is a jQuery expression referring to the part of the DOM that must be translated into language. $target provides the context or the part of the DOM that is to be translated and/or refreshed. If you provide only $target and not language, this part of the DOM is only refreshed.

Changing the language also translates the website when translations are provided.

Examples

$.udb.ui.setLanguage( "en" );

$.udb.ui.setLanguage( "en", $("button, input[type="button"]") );

$.udb.ui.setLanguage( $("button, input[type="button"]") );

 

 

collapseJSON files
collapseKey is preserved during translation
collapseShowing and hiding language-specific blocks
collapseMarkers

 

 

See Also

Localisation