Architecture:MediaWiki/internationalization domain

From mediawiki.org


The internationalization domain is concerned with adopting the presentation of content to the user's locale. This includes providing user interface messages in the user's language as well as allowing content to be maintained in multiple languages.

Other domains this domain depends on:

  • TBD

Some domains using to this domain:

  • TBD

Layers:
This domain is focused mainly on the User interface layer, but may have code in other layers as well, for instance to provide storage abstractions for user interface messages in the persistence layer and models for multi-lingual content in the value layer.

Location:
Files belonging to this domain are currently mostly located in the languages directory.

Status:
As of June 2020, the internationalization domain is heavily entangled with the rest of the system via the prolific Language class. Other aspects of this domain are not present in core at all, but are handled by the Translate extension.

Examples:
The languages/LanguageConverter.php class is an example for a component from the internationalization domain.

Vocabulary Survey[edit]

This is a rough survey of essential nouns and verbs that belong to the domain, providing a preliminary vocabulary. The survey is guided by existing code, but also includes nouns and verbs found to be missing.

Nouns:

  • Language: exists, should become a data object in the value layer. Accessed from other domains for various reasons.
  • Message: exists, should become a data object in the value layer. Accessed from other domains for various reasons.
  • Variant: exists, but is not directly modeled.
  • Translation: exists, but not in core.
  • Formatter: exists as part of the Language class

Verbs:

  • localize: render entire documents or interfaces in a language-specific way
  • format: render individual bits of data in a language-specific way
  • translate: provide content in one language based on another, by human effort
  • convert: provide content in one language based on another, automatically