addTranslation method

void addTranslation(
  1. BuildContext context,
  2. Translation translation
)

Adds a translation to the manager and requests a UI update.

context is the build context, used to mark the widget t ree as needing a rebuild. translation is the translation to add.

Implementation

void addTranslation(BuildContext context, Translation translation) {
  if (!loader.includedTranslations.contains(translation.name)) {
    loadTranslation(translation);
    (context as Element).markNeedsBuild();
    logger.log("Added Translation: ${translation.name}", type: LogType.info);
  }
}