...
For dynamic language strings, where the value is not known ahead of time, they may be loaded asynchronously using the loadLangStrings API from tui/i18n:
Code Block | ||
---|---|---|
| ||
import { langString, loadLangStrings } from 'tui/i18n'; function getMessage(message) { const str = langString('message:' + messageId, 'totara_tui'); await loadLangStrings([str]); console.log( return str.toString()); } |
Implementation (Totara 13-18)
...