mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
Verify seed phrase (#1700)
* 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]
This commit is contained in:
@@ -5,13 +5,14 @@ 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) {
|
||||
if (args.length < 2) {
|
||||
throw Exception(
|
||||
'Insufficient arguments!\n\nTry to run `./append_translation.dart greetings "Hello World!"`');
|
||||
'Insufficient arguments!\n\nTry to run `./append_translation.dart "greetings" "Hello World!"`');
|
||||
}
|
||||
|
||||
final name = args.first;
|
||||
final text = args.last;
|
||||
final text = args[1];
|
||||
final force = args.last == "--force";
|
||||
|
||||
print('Appending "$name": "$text"');
|
||||
|
||||
@@ -20,7 +21,7 @@ void main(List<String> args) async {
|
||||
final fileName = getArbFileName(lang);
|
||||
final translation = await getTranslation(text, lang);
|
||||
|
||||
appendStringToArbFile(fileName, name, translation);
|
||||
appendStringToArbFile(fileName, name, translation, force: force);
|
||||
}
|
||||
|
||||
print('Alphabetizing all files...');
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
void appendStringToArbFile(String fileName, String name, String text) {
|
||||
void appendStringToArbFile(String fileName, String name, String text, {bool force = false}) {
|
||||
final file = File(fileName);
|
||||
final arbObj = readArbFile(file);
|
||||
|
||||
if (arbObj.containsKey(name)) {
|
||||
if (arbObj.containsKey(name) && !force) {
|
||||
print("String $name already exists in $fileName!");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user