addTranslation method

void addTranslation(
  1. String locale,
  2. Message translated
)

Record the translation for this message in the given locale, after suitably escaping it.

Implementation

void addTranslation(String locale, Message translated) {
  translated.parent = this;
  translations[locale] = translated.toCode();
  jsonTranslations[locale] = translated.toJson();
}