Index

i18n

MMO.i18n · 5 symbols · generated 30 Sep 2026

constant

DATE_PREFIX

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

getTranslations

i18n.js:16

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:50

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:77

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:107

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