Skip to content

translate()

The translate method is the method that will translate a single string. It takes two arguments:

  • key: The translation key.
  • lang: The language to translate to from the translation object.
twoMi18n.translate("hello", "fr"); // Bonjour

See Fallbacks.