2023-08-29 16:11:51 +00:00
|
|
|
import 'utils/translation/arb_file_utils.dart';
|
|
|
|
import 'utils/translation/translation_constants.dart';
|
|
|
|
import 'utils/translation/translation_utils.dart';
|
2023-08-24 13:54:05 +00:00
|
|
|
|
|
|
|
void main(List<String> args) async {
|
|
|
|
if (args.length != 2) {
|
|
|
|
throw Exception(
|
|
|
|
'Insufficient arguments!\n\nTry to run `./append_translation.dart greetings "Hello World!"`');
|
|
|
|
}
|
|
|
|
|
|
|
|
final name = args.first;
|
|
|
|
final text = args.last;
|
|
|
|
|
|
|
|
print('Appending "$name": "$text"');
|
|
|
|
|
|
|
|
for (var lang in langs) {
|
2023-08-29 16:11:51 +00:00
|
|
|
final fileName = getArbFileName(lang);
|
2023-08-24 13:54:05 +00:00
|
|
|
final translation = await getTranslation(text, lang);
|
|
|
|
|
2023-08-29 16:11:51 +00:00
|
|
|
appendStringToArbFile(fileName, name, translation);
|
2023-08-24 13:54:05 +00:00
|
|
|
}
|
2023-09-06 21:15:20 +00:00
|
|
|
}
|