generateIndividualMessageFile method

void generateIndividualMessageFile(
  1. String basicLocale,
  2. Iterable<TranslatedMessage> translations,
  3. String targetDir
)

Generate a file <generated_file_prefix>messages<locale>.dart for the translations in locale and put it in targetDir.

Implementation

void generateIndividualMessageFile(String basicLocale,
    Iterable<TranslatedMessage> translations, String targetDir) {
  final content = contentForLocale(basicLocale, translations);

  // To preserve compatibility, we don't use the canonical version of the
  // locale in the file name.
  final filename = path.join(
      targetDir, '${generatedFilePrefix}messages_$basicLocale.dart');
  File(filename).writeAsStringSync(content);
}