LocaleStringTable.merge constructor

LocaleStringTable.merge(
  1. List<LocaleStringTable> tables
)

Merges tables into a single table (later entries win on conflict).

Implementation

factory LocaleStringTable.merge(List<LocaleStringTable> tables) {
  assert(tables.isNotEmpty, 'merge() requires at least one table.');
  final merged = <String, String>{};
  for (final t in tables) {
    merged.addAll(t._strings);
  }
  return LocaleStringTable(locale: tables.first.locale, strings: merged);
}