load method

Future<void> load()

Load the translations from filename based on the locale.

Implementation

Future<void> load() async {
  print("$runtimeType - loading '$filename'");

  String jsonString = await rootBundle.loadString(filename, cache: false);

  Map<String, dynamic> jsonMap =
      json.decode(jsonString) as Map<String, dynamic>;
  translations = jsonMap.map((key, value) => MapEntry(key, value.toString()));
}