addTranslation method
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();
}