The languages
plugin enables multilanguage trees. This means that each node has a specified number of titles - each in a different "language". Only one language set is visible at any given time. This is useful for maintaining the same structure in many languages (hence the name of the plugin)
Expects an array of language codes. Each of the items is used as a CSS class name, so make sure you specify only valid CSS class name strings. The first langauge will be visible onload. For example:
[ "en", "de", "bg" ]
Check your data plugin documentation (html_data, xml_data, json_data) or take a close look at these examples for information on how to specify multilanguage nodes.
Set the tree's visible language. Triggers an event.
string
number
lang
Either the language code string (as specified in the config) or an index from the config array.
Returns the name of the currently visible language.
Returns the needed string from the core config object. Overwrites the get_string function from the core. If the key does not exist in that language, but exists in the root of the object - that is returned, if even that does not exist - the key itself is returned.
string
key
The name of the string you are looking for. If you want to use the localize option just set the strings core config option to an object like this one: strings : { "lang-code-here" : { "string-key" : "string-value" ... }, "other-lang" : { ... } }
, otherwise _get_strings won't be affected.
string
lang
The language code string (as specified in the config) to get the key in. If not specified the currently visible language is used.
Returns the title of a node. Overwrites the get_text function from the core.
mixed
node
This can be a DOM node, jQuery node or selector pointing to the element whose title you need.
string
lang
The language code string (as specified in the config) to get the title in. If you omit this - the currently visible language is used.
Sets the title of a node. Overwrites the set_text function from the core. This is used internally - you should use rename_node. Since rename_node
uses set_text
internally you can pass a language string as a third parameter to rename_node.
mixed
node
This can be a DOM node, jQuery node or selector pointing to the element whose title you want to change.
string
text
The new title.
string
lang
The language code string (as specified in the config) to get the title in. If you omit this - the currently visible language is used.
used only internally to include the CSS necessary for the plugin onload.
Overwrites the create_node function from the core. To create a node with a few titles use an array for the data
property of the js
parameter:
{ "data" : [ { "title" : "EN title", language : "en" }, { "title" : "BG заглавие", language : "bg" } ] }