translate method

Future<void> translate()

Searching for all Strings in the project that use the .tr extension. Creates language files based on the provided language codes and translates via DeepL if wanted.

Implementation

Future<void> translate() async {
  final fileNamesWithTranslation = await _getFileNamesWithTranslations();
  await _writeTranslationsToBaseFile(fileNamesWithTranslation);

  final allTranslations = <String>[];

  for (var value in fileNamesWithTranslation.values) {
    allTranslations.addAll(value);
  }

  await _writeTranslationsToAllTranslationFiles(
    allTranslations,
    fileNamesWithTranslation,
  );
}