parseMessageFile method

Future<MessagesWithMetadata> parseMessageFile(
  1. AssetId assetId
)

Implementation

Future<MessagesWithMetadata> parseMessageFile(AssetId assetId) async {
  final arbFile = await buildStep.readAsString(assetId);
  final decoded = jsonDecode(arbFile) as Map;
  final arb = Map.castFrom<dynamic, dynamic, String, dynamic>(decoded);
  final inferredLocale = path
      .basenameWithoutExtension(assetId.path)
      .split('_')
      .skip(1)
      .join('_');
  final messageList = ArbParser(options.findById).parseMessageFile(
    arb,
    assetId,
    inferredLocale,
  );
  return messageList;
}