generateIndividualMessageFile method
void
generateIndividualMessageFile(
- String basicLocale,
- Iterable<
TranslatedMessage> translations, - 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);
}