MCPcopy Create free account
hub / github.com/facebook/Rapid / tHtml

Method tHtml

modules/core/LocalizationSystem.js:477–485  ·  view source on GitHub ↗

* t.html * Returns the localized text wrapped in an HTML span element encoding the locale info * @param {string} stringID string identifier * @param {Object?} replacements token replacements and default string * @param {string?} locale locale to use (defaults to curre

(stringID, replacements, locale)

Source from the content-addressed store, hash-verified

475 * @return {string} localized string wrapped in a HTML span, or empty string ''
476 */
477 tHtml(stringID, replacements, locale) {
478 let localeParam = null;
479 if (typeof locale === 'string') localeParam = [locale];
480 else if (Array.isArray(locale)) localeParam = locale;
481
482 const info = this._resolveString(stringID, replacements, localeParam);
483 // text may be empty or undefined depending on `replacements.default`
484 return info.text ? this.htmlForLocalizedText(info.text, info.locale) : '';
485 }
486
487
488 /**

Callers

nothing calls this directly

Calls 2

_resolveStringMethod · 0.95
htmlForLocalizedTextMethod · 0.95

Tested by

no test coverage detected