ImportXmlCommand constructor

ImportXmlCommand()

Implementation

ImportXmlCommand()
    : super(
        'import_xml',
        'Import translations from Google Play '
            "to the project's xml files. "
            'By default only files for existing locales will be imported. '
            'If you want to import new locales, use --$_argNew argument.\n'
            'If filename has suffix "${L10nUtils.diffsSuffix}" - it will be imported as a diff file. '
            'You can alter this behavior with --$_argDiffs argument.',
      ) {
  argParser
    ..addOption(
      _argPath,
      abbr: 'p',
      help: 'Path to the directory with translations from Google Play.',
      valueHelp: 'PATH',
    )
    ..addOption(
      _argFile,
      abbr: 'f',
      help: 'Filename for import (without extension). '
          'For example: intl, strings, info_plist, etc. '
          'By default main localization file will be imported. '
          'You can use --$_argAll to import all files.',
      valueHelp: 'FILENAME',
    )
    ..addOption(
      _argTarget,
      abbr: 't',
      help:
          'Target filename, to which the import will be made (without extension). '
          'For example if translation file has incorrect name "intl_en", '
          'you can provide the expected target name "intl" with this argument. '
          "Can't be used if --$_argAll passed.",
      valueHelp: 'FILENAME',
    )
    ..addOption(
      _argLocale,
      abbr: 'l',
      help: 'Locale for import. '
          'If not specified - all locales will be imported.',
      valueHelp: 'LOCALE',
    )
    ..addFlag(
      _argAll,
      help: 'Import all files from provided path.',
    )
    ..addFlag(
      _argNew,
      help: 'Import files for new locales from provided path.',
    )
    ..addFlag(
      _argDiffs,
      defaultsTo: null,
      help: 'Import strings as diffs or replace a whole file. '
          'If this argument is not defined, alex will decide how to export based on the filename.',
    );
}