addTranslations method

void addTranslations({
  1. required I18nLocale locale,
  2. String namespace = 'not relevant',
  3. required Map<String, dynamic> translations,
})

Add a namespace and its translations Namespace may be ignored if this feature is not used

Implementation

void addTranslations({
  required I18nLocale locale,
  String namespace = 'not relevant',
  required Map<String, dynamic> translations,
}) {
  if (!_internalMap.containsKey(locale)) {
    // ensure that the locale exists
    _internalMap[locale] = {};
  }

  _internalMap[locale]![namespace] = translations;
}