From a0a3910adc7cda241c9d16fca271be31c4f3a5af Mon Sep 17 00:00:00 2001
From: atlasan <gmorittu@gmail.com>
Date: Sun, 26 Feb 2023 02:23:28 +0100
Subject: [PATCH] translation updates, styles try?

---
 assets/translations/en.json                   |  6 ++-
 assets/translations/es.json                   |  5 ++-
 assets/translations/fr.json                   |  5 ++-
 assets/translations/it.json                   |  3 +-
 integration_test/duniter/data/node.key        |  1 +
 integration_test/utility/general_actions.dart | 11 ++---
 lib/providers/wallet_options.dart             |  2 +-
 lib/providers/wallets_profiles.dart           |  2 +-
 lib/screens/myWallets/unlocking_wallet.dart   |  8 ++--
 lib/screens/onBoarding/10.dart                |  8 ++--
 lib/screens/transaction_in_progress.dart      |  5 ++-
 lib/styles.dart                               | 43 +++++++++++++++++++
 12 files changed, 79 insertions(+), 20 deletions(-)
 create mode 100644 integration_test/duniter/data/node.key
 create mode 100644 lib/styles.dart

diff --git a/assets/translations/en.json b/assets/translations/en.json
index 938cb799..8279bfbd 100644
--- a/assets/translations/en.json
+++ b/assets/translations/en.json
@@ -212,5 +212,9 @@
     "indexer": "Indexer",
     "anAutoNodeChoosed": "A secure and valid node will be automatically used from a random list.",
     "rootWallet": "Root Wallet",
-    "blockN": "block N°{}"
+    "blockN": "block N°{}",
+    "thisIsNotAGoodCode": "This is not a good code",
+    "youHaveToBeConnectedToValidateChest": "You have to be connected\nto validate your chest",
+    "thisIdentityAlreadyExist": "This identity already exists"
+    
 }
\ No newline at end of file
diff --git a/assets/translations/es.json b/assets/translations/es.json
index 2cb824b3..5279a92a 100644
--- a/assets/translations/es.json
+++ b/assets/translations/es.json
@@ -213,5 +213,8 @@
     "indexer": "Indexer",
     "anAutoNodeChoosed": "Se usará automáticamente un nodo seguro y valido desde una lista aleatoria.",
     "rootWallet": "Monedero raíz",
-    "blockN": "bloque N°{}"
+    "blockN": "bloque N°{}",
+    "thisIsNotAGoodCode": "Este codígo no es valido",
+    "youHaveToBeConnectedToValidateChest": "Tienes que tener conneción\npara validar tu cofre",
+    "thisIdentityAlreadyExist": "Esta identidad ya existe"
 }
diff --git a/assets/translations/fr.json b/assets/translations/fr.json
index a1700b8c..026a3828 100644
--- a/assets/translations/fr.json
+++ b/assets/translations/fr.json
@@ -212,5 +212,8 @@
     "indexer": "Indexer",
     "anAutoNodeChoosed": "Un noeud sûr et valide sera choisi automatiquement parmis une liste aléatoire.",
     "rootWallet": "Portefeuille racine",
-    "blockN": "bloc N°{}"
+    "blockN": "bloc N°{}",
+    "thisIsNotAGoodCode": "Ce n'est pas le bon code",
+    "youHaveToBeConnectedToValidateChest": "Vous devez vous connecter à internet\npour valider votre coffre",
+    "thisIdentityAlreadyExist": "Cette identité existe déjà"
 }
diff --git a/assets/translations/it.json b/assets/translations/it.json
index cf22653c..b2fa4928 100644
--- a/assets/translations/it.json
+++ b/assets/translations/it.json
@@ -215,5 +215,6 @@
     "rootWallet": "Portafoglio radice",
     "blockN": "blocco N°{}",
     "thisIsNotAGoodCode": "Questo codice non é valido",
-    "youHaveToBeConnectedToValidateChest": "Vous devez vous connecter à internet\npour valider votre coffre"
+    "youHaveToBeConnectedToValidateChest": "Vous devez vous connecter à internet\npour valider votre coffre",
+    "thisIdentityAlreadyExist": "Identitá giá esistente"
 }
\ No newline at end of file
diff --git a/integration_test/duniter/data/node.key b/integration_test/duniter/data/node.key
new file mode 100644
index 00000000..aa131f76
--- /dev/null
+++ b/integration_test/duniter/data/node.key
@@ -0,0 +1 @@
+7bd0907a4984e1ab7899edce63b2e286e8f3daad5a8e2bff40cee61ca6b036cd
\ No newline at end of file
diff --git a/integration_test/utility/general_actions.dart b/integration_test/utility/general_actions.dart
index 2bf06f5d..d1f3ceaf 100644
--- a/integration_test/utility/general_actions.dart
+++ b/integration_test/utility/general_actions.dart
@@ -1,3 +1,4 @@
+import 'package:easy_localization/easy_localization.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_dotenv/flutter_dotenv.dart';
 import 'package:flutter_test/flutter_test.dart';
@@ -66,7 +67,7 @@ Future restoreChest() async {
   await enterText(keyPinForm, 'AAAAA', 0);
 
   // Check if string "Accéder à mon coffre" is present in screen
-  await waitFor('Accéder à mon coffre');
+  await waitFor('accessMyChest'.tr());
 
   // Go to wallets home
   await tapKey(keyGoWalletsHome, duration: 0);
@@ -84,7 +85,7 @@ Future restoreChest() async {
   await tapKey(keyCopyAddress);
 
   // Check if string "Cette adresse a été copié" is present in screen
-  await waitFor('Cette adresse a été copié');
+  await waitFor('thisAddressHasBeenCopiedToClipboard'.tr());
 
   // Pop screen 2 time to go back home
   await goBack();
@@ -126,7 +127,7 @@ Future onboardingNewChest() async {
 
   final askedWord = mnemonic[askedWordNumber - 1];
   await enterText(keyInputWord, askedWord);
-  await waitFor('Continuer', exactMatch: true);
+  await waitFor('continue'.tr(), exactMatch: true);
   await tapKey(keyGoNext);
   await tapKey(keyGoNext);
   await tapKey(keyGoNext);
@@ -143,13 +144,13 @@ Future onboardingNewChest() async {
   await enterText(keyPinForm, 'AAAAA', 0);
 
   // Check if string "Accéder à mon coffre" is present in screen
-  await waitFor('Accéder à mon coffre');
+  await waitFor('accessMyChest'.tr());
 
   // Go to wallets home
   await tapKey(keyGoWalletsHome, duration: 0);
 
   // Check if string "Mon portefeuille co" is present in screen
-  await waitFor('Mon portefeuille co');
+  await waitFor('currentWallet'.tr());
   await waitFor('0.0', exactMatch: true);
   // await waitFor('Scanner un');
 }
diff --git a/lib/providers/wallet_options.dart b/lib/providers/wallet_options.dart
index aa68aee2..b672ef62 100644
--- a/lib/providers/wallet_options.dart
+++ b/lib/providers/wallet_options.dart
@@ -178,7 +178,7 @@ class WalletOptionsProvider with ChangeNotifier {
               ),
               const SizedBox(height: 10),
               Consumer<WalletOptionsProvider>(builder: (context, wOptions, _) {
-                return Text(idtyExist ? 'Cette identité existe déjà' : '',
+                return Text(idtyExist ? "thisIdentityAlreadyExist".tr() : '',
                     style: TextStyle(color: Colors.red[500]));
               })
             ]),
diff --git a/lib/providers/wallets_profiles.dart b/lib/providers/wallets_profiles.dart
index 5782ab2b..2b7ecf05 100644
--- a/lib/providers/wallets_profiles.dart
+++ b/lib/providers/wallets_profiles.dart
@@ -30,7 +30,7 @@ class WalletsProfilesProvider with ChangeNotifier {
     try {
       barcode = await BarcodeScanner.scan();
     } catch (e) {
-      log.e(e);
+      log.e("BarcodeScanner ERR: $e");
       return 'false';
     }
     if (isAddress(barcode.rawContent)) {
diff --git a/lib/screens/myWallets/unlocking_wallet.dart b/lib/screens/myWallets/unlocking_wallet.dart
index 18ddf30a..6f2b2ceb 100644
--- a/lib/screens/myWallets/unlocking_wallet.dart
+++ b/lib/screens/myWallets/unlocking_wallet.dart
@@ -100,7 +100,8 @@ class UnlockingWallet extends StatelessWidget {
                                   style: const TextStyle(
                                       fontSize: 25,
                                       color: Colors.black,
-                                      fontWeight: FontWeight.w700),
+                                      fontWeight: FontWeight.w700
+                                  ),
                                 )),
                           ]),
                       SizedBox(height: 30 * ratio),
@@ -111,13 +112,14 @@ class UnlockingWallet extends StatelessWidget {
                             style: const TextStyle(
                                 fontSize: 19,
                                 color: Colors.black,
-                                fontWeight: FontWeight.w400),
+                                fontWeight: FontWeight.w400
+                            ),
                           )),
                       SizedBox(height: 30 * ratio),
                       if (!myWalletProvider.isPinValid &&
                           !myWalletProvider.isPinLoading)
                         Text(
-                          "Ce n'est pas le bon code".tr(),
+                          "thisIsNotAGoodCode".tr(),
                           style: const TextStyle(
                               color: Colors.red, fontWeight: FontWeight.w500),
                         ),
diff --git a/lib/screens/onBoarding/10.dart b/lib/screens/onBoarding/10.dart
index 337132ad..92eff67b 100644
--- a/lib/screens/onBoarding/10.dart
+++ b/lib/screens/onBoarding/10.dart
@@ -105,7 +105,7 @@ class OnboardingStepTen extends StatelessWidget {
                     visible: !myWalletProvider.isPinValid &&
                         !myWalletProvider.isPinLoading,
                     child: Text(
-                      "Ce n'est pas le bon code".tr(),
+                      "thisIsNotAGoodCode".tr(),
                       style: const TextStyle(
                           color: Colors.red, fontWeight: FontWeight.w500),
                     ),
@@ -117,10 +117,10 @@ class OnboardingStepTen extends StatelessWidget {
                       ? pinForm(context, walletOptions, pinLenght, 1, 2)
                       : Row(
                           mainAxisAlignment: MainAxisAlignment.center,
-                          children: const [
+                          children: [
                               Text(
-                                'Vous devez vous connecter à internet\npour valider votre coffre',
-                                style: TextStyle(
+                                "youHaveToBeConnectedToValidateChest".tr(),
+                                style: const TextStyle(
                                   fontSize: 20,
                                   color: Colors.redAccent,
                                   fontWeight: FontWeight.w500,
diff --git a/lib/screens/transaction_in_progress.dart b/lib/screens/transaction_in_progress.dart
index 77451f62..8e629740 100644
--- a/lib/screens/transaction_in_progress.dart
+++ b/lib/screens/transaction_in_progress.dart
@@ -42,6 +42,8 @@ class TransactionInProgress extends StatelessWidget {
     String actionName = '';
     final bool isUdUnit = configBox.get('isUdUnit') ?? false;
 
+    log.d("$transType :: $actionName :: $result");
+
     switch (transType) {
       case 'pay':
         {
@@ -94,7 +96,6 @@ class TransactionInProgress extends StatelessWidget {
         {
           isLoading = false;
           // jsonResult = json.decode(_result);
-          log.d(result);
           if (result.contains('blockHash: ')) {
             isValid = true;
             resultText = 'extrinsicValidated'.tr(args: [actionName]);
@@ -110,7 +111,7 @@ class TransactionInProgress extends StatelessWidget {
             } else {
               exception = exceptionSplit[0];
             }
-            // log.d('expection: $_exception');
+            log.d('expection: $exceptionSplit');
             switch (exception) {
               case 'cert.NotRespectCertPeriod':
               case 'identity.CreatorNotAllowedToCreateIdty':
diff --git a/lib/styles.dart b/lib/styles.dart
new file mode 100644
index 00000000..75ba9257
--- /dev/null
+++ b/lib/styles.dart
@@ -0,0 +1,43 @@
+// import 'dart:io';
+import 'package:flutter/material.dart';
+// import 'package:logger/logger.dart';
+
+// --- THIS IS WIP ---
+
+class GeckoStyles {
+
+  TextStyle successBold(List<String> pars) {
+    return TextStyle(
+      color: Colors.green.shade600,
+      fontWeight: FontWeight.bold,
+    );
+  }
+
+  TextStyle success() {
+    return TextStyle(
+      color: Colors.green.shade600
+    );
+  }
+
+  TextStyle error500(List<String> pars) {
+    return const TextStyle(
+      fontSize: 20,
+      color: Colors.redAccent,
+      fontWeight: FontWeight.w500,
+    );
+  }
+
+  TextStyle error() {
+    return const TextStyle(fontSize: 20, color: Colors.redAccent);
+  }
+
+  TextStyle builder(Map<String, dynamic> pars) {
+    // pars["hola"] = 20;
+    // //int a = double.tryParse(source) pars["hola"];
+    // return const TextStyle( fontSize: double.tryParse(pars["hola"]),
+    //                         color: Colors.redAccent,
+    //                         fontWeight: FontWeight.w500
+    //                       );
+    return const TextStyle();
+  }
+}
-- 
GitLab