Index

i18n

MMO.i18n · 6 symbols · generated 5 Oct 2026

constant

DATE_PREFIX

i18n.js:7
MMO.i18n.DATE_PREFIX = '/dates:';
Namespace
MMO.i18n
function

defaultLanguage

i18n.js:14

The language texts are translated to when none is asked for: the page's own (<html lang>, which the server writes), then the browser's. A French application seen in an English browser speaks French.

function MMO.i18n.defaultLanguage()
Namespace
MMO.i18n
returnsstring
function

getTranslations

i18n.js:25

Get the translation map for a given language

function MMO.i18n.getTranslations(lang, create = false)
Namespace
MMO.i18n
lang?stringthe locale to use
create = falsebooleanif true will create a new Map. else throw an exception if Map does not exist
returnsMapAll the translations Map indexed by their languages
function

load

i18n.js:59

Load translations for a given language

function MMO.i18n.load(lang, texts)
Namespace
MMO.i18n
langstringthe locale to use ('fr', 'en', ...)
textsMap | Objectthe texts to load (key => translation)
function

$

i18n.js:86

Get translation for a given text

function MMO.i18n.$(text, lang = null, options = {})
Namespace
MMO.i18n
textstring | numberShould be the complete text in english
lang = null?stringthe locale to use ('fr', 'en', ...)
options = {}stringthe options to pass: - numbers: options for Intl - date: {format: php format}
returnsstring
function

currency

i18n.js:117

Format a number as a currency amount, in the user's locale.

function MMO.i18n.currency(number, currency = null, lang = null)
Namespace
MMO.i18n
number
currency = nullstringan ISO 4217 code ('EUR', 'USD', ...)
lang = null
returnsstring