... | @@ -68,6 +68,8 @@ in which case the message above could become |
... | @@ -68,6 +68,8 @@ in which case the message above could become |
|
|
|
|
|
This lets you avoid having to repeat the domain within every call to `_()` in the input jax. (It would also be possible for `TEX.Error()` to call `_()` for you, but see below for information about obtaining the translation data.)
|
|
This lets you avoid having to repeat the domain within every call to `_()` in the input jax. (It would also be possible for `TEX.Error()` to call `_()` for you, but see below for information about obtaining the translation data.)
|
|
|
|
|
|
|
|
The default domain is `"*"`.
|
|
|
|
|
|
|
|
|
|
### Substitutions ###
|
|
### Substitutions ###
|
|
|
|
|
... | @@ -144,3 +146,38 @@ In fact, you can supply as much meta-data between the braces as you would like. |
... | @@ -144,3 +146,38 @@ In fact, you can supply as much meta-data between the braces as you would like. |
|
|
|
|
|
## The Localization Data ##
|
|
## The Localization Data ##
|
|
|
|
|
|
|
|
The `MathJax.Localization` object holds the data for the various translations, as well as the service routines for adding to the translations, and retrieving translations.
|
|
|
|
|
|
|
|
### Methods ###
|
|
|
|
|
|
|
|
The methods in `MathJax.Localization` include:
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
|
|
|
|
<dt>_(id,message[,form][,arguments])</dt>
|
|
|
|
<dd>The function described in detail above that returns the translated string for a given id.</dd>
|
|
|
|
|
|
|
|
<dt>setLocale(locale)</dt>
|
|
|
|
<dd>Sets the selected locale to the given one, e.g. <code>MathJax.Localization.setLocale("fr");</code></dd>
|
|
|
|
|
|
|
|
<dt>addTranslation(local,domain,def)</dt>
|
|
|
|
<dd>Defines (or adds to) the translation data for the given <code>locale</code> and <code>domain</code>. The <code>def</code> is the definition to be merged with the current translation data (if it exists) or to be used as the complete definition (if not). The data format is described below.</dd>
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
### Properties ###
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>locale</dt>
|
|
|
|
<dd>the currently selected locale, e.g., <code>"fr"</code></dd>
|
|
|
|
|
|
|
|
<dt>directory</dt>
|
|
|
|
<dd>The URL for the localization data files. This can be overridden for individual languages or domains (see below). The default is <code>[MathJax]/localization</code>.</dd>
|
|
|
|
|
|
|
|
<dt>strings</dt>
|
|
|
|
<dd>This is the main data structure that holds the translation strings. It consists of an entry for each language that MathJax knows about, e.g., there would be an entry with key `fr` whose value is the data for the Frenchtranslation. Initially, these simply reference the files that define the translation data, which MathJax will load when needed. After the file is loaded, they will contain the translation data as well. This is described in more detail below.</dd>
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
## The Translation Files ## |