MCPcopy
hub / github.com/MagicMirrorOrg/MagicMirror / translate

Method translate

js/module.js:332–337  ·  view source on GitHub ↗

* Request the translation for a given key with optional variables and default value. * @param {string} key The key of the string to translate * @param {string|object} [defaultValueOrVariables] The default value or variables for translating. * @param {string} [defaultValue] The default value wi

(key, defaultValueOrVariables, defaultValue)

Source from the content-addressed store, hash-verified

330 * @returns {string} the translated key
331 */
332 translate (key, defaultValueOrVariables, defaultValue) {
333 if (typeof defaultValueOrVariables === "object") {
334 return Translator.translate(this, key, defaultValueOrVariables) || defaultValue || "";
335 }
336 return Translator.translate(this, key) || defaultValueOrVariables || "";
337 }
338
339 /**
340 * Request an (animated) update of the module.

Callers 10

nunjucksEnvironmentMethod · 0.95
getDomFunction · 0.80
startFunction · 0.80
getDomFunction · 0.80
buildAbsoluteTimeTextFunction · 0.80
buildRelativeTimeTextFunction · 0.80
getDomFunction · 0.80
translator_spec.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected