mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39:22 +00:00
d0b51cebe3
* - Update Camera purpose string for iOS - Fix address field not passing the correct currency to address book * Enhance file loading in exception handler * Fix translation consistency [skip ci]
39 lines
1.1 KiB
Dart
39 lines
1.1 KiB
Dart
import 'dart:io';
|
|
|
|
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 {
|
|
print('Checking Consistency of all arb-files. Default: $defaultLang');
|
|
|
|
final doFix = args.contains("--fix");
|
|
|
|
if (doFix)
|
|
print('Auto fixing enabled!\n');
|
|
else
|
|
print('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) {
|
|
print('Missing in "$lang": "$key"');
|
|
if (doFix)
|
|
missingDefaults[key] = arbObj[key] as String;
|
|
});
|
|
|
|
if (missingDefaults.isNotEmpty) {
|
|
await appendTranslations(lang, missingDefaults);
|
|
alphabetizeArbFile(fileName);
|
|
}
|
|
}
|
|
}
|
|
}
|