mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
c78662fbfe
* replace all print statements with printV * restore backup error message * missing print statements, error fixes * Update cw_core/lib/utils/print_verbose.dart [skip ci] * Update cw_core/lib/utils/print_verbose.dart [skip ci] * CW-846: Correctly display balance (#1848) * Correctly display balance even with frozen coins * remove package= from AndroidMainfest.xml * update namespace * print -> printV --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
41 lines
1.2 KiB
Dart
41 lines
1.2 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:cw_core/utils/print_verbose.dart';
|
|
|
|
import 'utils/translation/arb_file_utils.dart';
|
|
import 'utils/translation/translation_constants.dart';
|
|
import 'utils/translation/translation_utils.dart';
|
|
|
|
void main(List<String> args) async {
|
|
printV('Checking Consistency of all arb-files. Default: $defaultLang');
|
|
|
|
final doFix = args.contains("--fix");
|
|
|
|
if (doFix)
|
|
printV('Auto fixing enabled!\n');
|
|
else
|
|
printV('Auto fixing disabled!\nRun with arg "--fix" to enable autofix\n');
|
|
|
|
final fileName = getArbFileName(defaultLang);
|
|
final file = File(fileName);
|
|
final arbObj = readArbFile(file);
|
|
|
|
for (var lang in langs) {
|
|
final fileName = getArbFileName(lang);
|
|
final missingKeys = getMissingKeysInArbFile(fileName, arbObj.keys);
|
|
if (missingKeys.isNotEmpty) {
|
|
final missingDefaults = <String, String>{};
|
|
|
|
missingKeys.forEach((key) {
|
|
printV('Missing in "$lang": "$key"');
|
|
if (doFix)
|
|
missingDefaults[key] = arbObj[key] as String;
|
|
});
|
|
|
|
if (missingDefaults.isNotEmpty) {
|
|
await appendTranslations(lang, missingDefaults);
|
|
alphabetizeArbFile(fileName);
|
|
}
|
|
}
|
|
}
|
|
}
|