Plugin JavaScript Function phrase()

function module_class_name.phrase(
text, mrg
)

Summary

Retrieves one of the Phrases for your Plugin using AJAX.

Where You Can Use It

Anywhere in your JavaScript code. From Zenario 7.0.0 onwards.

Description

Zenario is a multilingual CMS, so you should not hardcode Phrases into your JavaScript code. Instead you should refer to all Phrases using Phrase-codes, and define their values in an xml file. This allows your Plugin to be translated into other languages by translating this file.

See the Plugin Phrases section for more information.

code

The codename of a Phrase to look up

replace

The values of any merge fields that your Phrase uses. Should be formed as a string of URL requests, in the format:

merge_field1=value&merge_field2=value...

May be omitted if your phrase has no merge fields (and most phrases tend not to).

Return Value

An escaped phrase in the visitor's local language.

Example

alert(plugin_class_name.phrase('_TEST_MESSAGE'));

A simple example that alerts the value of a Phrase.