load method

Future<bool> load()

Implementation

Future<bool> load() async {
  var languageCode = "es";
  if(locale.languageCode != languageCode){
    languageCode = locale.languageCode;
  }

  String jsonString = await rootBundle.loadString('i18n/$languageCode.json');
  Map<String, dynamic> jsonMap = json.decode(jsonString);

  _localizedStrings = jsonMap.map((key, value) {
    return MapEntry(key, value.toString());
  });

  return true;
}