Docs (4.0.0)
class LazyString method

translate

Translates the string using the current I18n provider.

translate(): LazyString

Notes

  • This method is called automatically by strf().
  • If no I18n provider (see app.i18n) is currently set, the current string value is used directly.
  • If the resulting string starts with ##, the translation marker and following space, OR optional description (between : characters) are removed: e.g. ##T_HELLO Hello, world or ##T_HELLO:User greeting:Hello, world. Spaces after the end of the description are not removed.

Return value

A new LazyString instance.

Related

  • class LazyStringAn object that encapsulates a string, evaluated only when needed.