getXmlFile method

  1. @protected
File getXmlFile(
  1. L10nConfig config, {
  2. XmlLocale? locale,
  3. String? name,
})

Implementation

@protected
File getXmlFile(L10nConfig config, {XmlLocale? locale, String? name}) {
  final xmlFileName = name ?? config.getMainXmlFileName();
  locale ??= config.baseLocaleForXml;

  final xmlFileDirPath = config.getXmlFilesPath(locale);
  final xmlFilePath = path.join(xmlFileDirPath, xmlFileName);
  final file = File(xmlFilePath);

  final exists = file.existsSync();
  if (!exists) {
    throw RunException.fileNotFound(
        'XML file for locale $locale is not found at ${file.path}');
  }
  return file;
}