mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-10-30 00:47:48 +00:00
11584844d5
* add confirm passphrase field and show/hide passphrase feature * change error message allow force appending translation to overwrite * minor fix for showing frozen balance correctly [skip ci] * remove debug prints [skip ci]
35 lines
No EOL
983 B
Dart
35 lines
No EOL
983 B
Dart
import 'utils/translation/arb_file_utils.dart';
|
|
import 'utils/translation/translation_constants.dart';
|
|
import 'utils/translation/translation_utils.dart';
|
|
|
|
/// flutter packages pub 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!');
|
|
} |