Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagejs
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)

...