cake_wallet/tool/append_translation.dart
cyan 505ea26533
CW-798 Fix macos 15 issues (#1775)
* update flutter to 3.24.3

* bump flutter to 3.24.4, fix all android issues (i hope)

* update uni_links path

* update sensitive_clipboard

* update dependencies

* update fast_scanner

* update the ref

* Update how_to_add_new_wallet_type.md [skip ci]

* Update how_to_add_new_wallet_type.md [skip ci]

* Update how_to_add_new_wallet_type.md [skip ci]

* Update how_to_add_new_wallet_type.md [skip ci]

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2024-11-25 16:08:30 +02:00

35 lines
No EOL
967 B
Dart

import 'utils/translation/arb_file_utils.dart';
import 'utils/translation/translation_constants.dart';
import 'utils/translation/translation_utils.dart';
/// dart run tool/append_translation.dart "hello_world" "Hello World!"
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[1];
final force = args.last == "--force";
print('Appending "$name": "$text"');
// add translation to all languages:
for (var lang in langs) {
final fileName = getArbFileName(lang);
final translation = await getTranslation(text, lang);
appendStringToArbFile(fileName, name, translation, force: force);
}
print('Alphabetizing all files...');
for (var lang in langs) {
final fileName = getArbFileName(lang);
alphabetizeArbFile(fileName);
}
print('Done!');
}