load method

Future<bool> load()

Load the translations from filename based on the locale.

Implementation

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

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

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

  return true;
}