Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • M MathJax
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 304
    • Issues 304
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MathJax
  • MathJax
  • Wiki
  • Localization Proposal

Localization Proposal · Changes

Page history
Updated Localization Proposal (markdown) authored Feb 05, 2013 by dpvc's avatar dpvc
Hide whitespace changes
Inline Side-by-side
Localization-Proposal.md
View page @ e9beb647
......@@ -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.)
The default domain is `"*"`.
### Substitutions ###
......@@ -144,3 +146,38 @@ In fact, you can supply as much meta-data between the braces as you would like.
## 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 ##
Clone repository

MathJax Wiki

  • Contributing
  • Development
    • Development Process
      • Release Process Checklist
      • Hotfix Release Process
      • Documentation Update Process
      • Source Control Policies
    • Design Documents
      • MathJax Roadmap
      • CDN Hosting
        • Managing Rackspace Cloud Files & CDN
        • Directory Structure
        • .htaccess settings
        • Managing Amazon Cloudfront
      • Performance Discussion
      • Profiling and Diagnostics Tools
      • Configuration Options
      • Documentation generation guide
      • Testing
        • Platforms supported
        • Test Machines
  • MathJax web presence
  • Drafts