startLocalization function

void startLocalization()

this is entry point of main file

Implementation

void startLocalization() {
  /// try to load settings from the project's pubspec.yaml
  final settings = _loadSettings();

  // display an error and quit if the input file hasn't been specified
  if ((settings[_YamlArguments.inputFilePath] == null)) {
    print(
        '[ERROR] Input file path not defined. This must be specified in pubspec.yaml\n');
    return;
  }

  /// parse csv to dart
  final excelTranslator = ExcelLocalizaton();
  excelTranslator.generate(
    settings[_YamlArguments.inputFilePath],
    outputDir: settings[_YamlArguments.outputDir],
    fileName: settings[_YamlArguments.fileName],
    className: settings[_YamlArguments.className],
    delimiter: settings[_YamlArguments.delimiter],
    startIndex: settings[_YamlArguments.startIndex],
    dependOnContext: settings[_YamlArguments.dependOnContext],
    useSingleQuotes: settings[_YamlArguments.useSingleQuotes],
    replaceNoBreakSpaces: settings[_YamlArguments.replaceNoBreakSpaces],
    exposeGetString: settings[_YamlArguments.exposeGetString],
    exposeLocaStrings: settings[_YamlArguments.exposeLocaStrings],
    exposeLocaleMaps: settings[_YamlArguments.exposeLocaleMaps],
    generateComments: settings[_YamlArguments.generateComments],
    commentLanguages: (settings[_YamlArguments.commentLanguages] as YamlList?)
        ?.map<String>((node) => node.toString())
        .toList(),
  );
}