app/packages/sct_dev_tools/bin/sct_dev_tools.dart

20 lines
582 B
Dart
Raw Normal View History

2024-03-14 21:49:21 +08:00
import 'auto_l10n.dart';
2024-03-17 12:44:50 +08:00
void main(List<String> args) async {
2024-03-14 21:49:21 +08:00
switch (args.elementAtOrNull(0)) {
2024-03-15 00:03:04 +08:00
case "l10n_gen":
2024-03-14 21:49:21 +08:00
return AutoL10nTools().genL10nFiles();
2024-03-15 00:03:04 +08:00
case "l10n_replace":
2024-03-15 00:01:06 +08:00
return AutoL10nTools().replaceL10nFiles();
2024-03-17 12:44:50 +08:00
case "l10n_auto_translate":
final form = args.elementAtOrNull(1);
final to = args.elementAtOrNull(2);
if (form == null || to == null) {
throw Exception("form or to is null");
}
return await AutoL10nTools().autoTranslate(form: form, to: to);
2024-03-14 21:49:21 +08:00
default:
2024-03-15 00:01:06 +08:00
throw Exception("cmd not found");
2024-03-14 21:49:21 +08:00
}
}