Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
AmdFFS.php File Reference

Support for the AMD i18n message file format (used by require.js and Dojo). More...

Go to the source code of this file.

Classes

class  AmdFFS
 AmdFFS implements a message format where messages are encoded as key-value pairs in JSON objects wrapped in a define call. More...
 

Detailed Description

Support for the AMD i18n message file format (used by require.js and Dojo).

See: http://requirejs.org/docs/api.html#i18n

A limitation is that it only accepts json compatible structures inside the define wrapper function. For example the following example is not ok since there are no quotation marks around the keys: define({ key1: "somevalue", key2: "anothervalue" });

Instead it should look like: define({ "key1": "somevalue", "key2": "anothervalue" });

It also supports the top-level bundle with a root construction and language indicators. The following example will give the same messages as above: define({ "root": { "key1": "somevalue", "key2": "anothervalue" }, "sv": true });

Note that it does not support exporting with the root construction, there is only support for reading it. However, this is not a serious limitation as Translatewiki doesn't export the base language.

Author
Matthias Palmér

Definition in file AmdFFS.php.