diff --git a/assets/onBoarding/forgot_password_en.png b/assets/onBoarding/forgot_password_en.png new file mode 100644 index 0000000..1fb7dfb Binary files /dev/null and b/assets/onBoarding/forgot_password_en.png differ diff --git a/assets/onBoarding/mot-de-passe-oublie.png b/assets/onBoarding/forgot_password_fr.png similarity index 100% rename from assets/onBoarding/mot-de-passe-oublie.png rename to assets/onBoarding/forgot_password_fr.png diff --git a/assets/translations/en.json b/assets/translations/en.json index 15afb25..b77c5c0 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -1,3 +1,55 @@ { - "msg": "hello {} there !" + "searchWallet": "Search\nwallet", + "manageWallets": "Manage\nwallets", + "scanQRCode": "Scan a\nQR code", + "wellConnectedToNode": "You are well connected to node\n{}", + "networkLost": "Network has been lost...", + "noDuniterEndointAvailable": "No server available...", + "connectionPending": "Connection pending...", + "noLizard": "no lounge lizard ;-)", + "loading": "Loading...", + "forgot_password.png": "forgot_password_en.png", + "warningForgotPassword": "In a blockchain, there is no email recovery procedure. Only your recovery phrase can allow you to recover your Ğ1 at any time.", + "fastAppDescription": "The {} app payment\nfaster than a reptile of Vietnam", + "createWallet": "Create a wallet", + "restoreWallet": "Restore my wallets", + "parameters": "Parameters", + "chooseAnotherMnemonic": "Choose an other\nmnemonic sentence", + "iNotedMyMnemonic": "I wrote down my sentence", + "printMyMnemonic": "Print my mnemonic sentence", + "manageChest": "Configure this chest", + "changeChest": "Change chest", + "geckoChest": "Ğecko chest", + "toUnlockEnterPassword": "To unlock your safe, enter your secret code, away from prying lizards:", + "rememberPassword": "Keep this code in memory for 15 minutes", + "myRootWallet": "My root wallet", + "currentWallet": "My current chest", + "wallet": "Wallet", + "displayMnemonic": "Display my mnemonic sentence", + "changePassword": "Change my password", + "createDerivation": "Create a new derivation", + "createCustomDerivation": "Create a new custom derivation", + "deleteChest": "Delete this chest", + "openThisChest": "Open this chest", + "createChest": "Create a new chest", + "importChest": "Import a chest", + "accessMyChest": "Access my chest", + "manageMembership": "Manage my membership", + "chooseThisWallet": "Choose this wallet", + "thisWalletIsDefault": "This wallet is the default one", + "defineWalletAsDefault": "Define this as the default one", + "displayActivity": "Display activity", + "memberValidated": "Validated member!", + "copyAddress": "Copy\naddress", + "copy": "Copy", + "thisAddressHasBeenCopiedToClipboard": "This address has been copied to clipboard", + "chooseWalletName": "Choose a new name\nfor your wallet:", + "choosePassword": "Choose a random password:", + "chooseDerivation": "Choose a derivation:", + "validate": "Validate", + "confirm": "Confirm", + "confirmPayment": "Confirm payment", + "clickHereToConfirmIdentity": "Click here to confirm\nyour new identity" + + } \ No newline at end of file diff --git a/assets/translations/fr.json b/assets/translations/fr.json index 475a3fa..4841f12 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -1,3 +1,55 @@ { - "msg": "Salut ici !" + "searchWallet": "Rechercher un\nportefeuille", + "manageWallets": "Gérer mes\nportefeuilles", + "scanQRCode": "Scanner un\nQR code", + "wellConnectedToNode": "Vous êtes bien connecté aux noeud\n{}", + "networkLost": "Le réseau a été perdu...", + "noDuniterEndointAvailable": "Aucun serveur disponible...", + "connectionPending": "Connexion en cours...", + "noLizard": "y'a pas de lézard ;-)", + "loading": "Chargement en cours...", + "forgot_password.png": "forgot_password_fr.png", + "warningForgotPassword": "Dans une blockchain, pas de procédure de récupération par mail. Seule votre phrase de restauration peut vous permettre de récupérer vos Ğ1 à tout moment.", + "fastAppDescription": "L’application de paiement {}\nplus rapide qu’un reptile du Vietnam", + "createWallet": "Créer un portefeuille", + "restoreWallet": "Restaurer mes portefeuilles", + "parameters": "Paramètres", + "chooseAnotherMnemonic": "Choisir une autre phrase", + "iNotedMyMnemonic": "J'ai noté ma phrase", + "printMyMnemonic": "Imprimer ma phrase de restauration", + "manageChest": "Paramétrer ce coffre", + "changeChest": "Changer de coffre", + "geckoChest": "Coffre à Ğecko", + "toUnlockEnterPassword": "Pour déverrouiller votre coffre, composez votre code secret à l’abri des lézards indiscrets :", + "rememberPassword": "Garder ce code en mémoire 15 minutes", + "myRootWallet": "Mon portefeuille racine", + "currentWallet": "Mon portefeuille courant", + "wallet": "Portefeuille", + "displayMnemonic": "Afficher ma phrase de restauration", + "changePassword": "Changer mon code secret", + "createDerivation": "Créer une autre dérivation", + "createCustomDerivation": "Créer une dérivation personnalisé", + "deleteChest": "Supprimer ce coffre", + "openThisChest": "Ouvrir ce coffre", + "createChest": "Créer un nouveau coffre", + "importChest": "Importer un coffre", + "selectMyChest": "Sélectionner mon coffre", + "accessMyChest": "Accéder à mon coffre", + "manageMembership": "Gérer mon adhésion", + "chooseThisWallet": "Choisir ce portefeuille", + "thisWalletIsDefault": "Ce portefeuille est celui par defaut", + "defineWalletAsDefault": "Définir comme portefeuille par défaut", + "displayActivity": "Voir l'activité", + "memberValidated": "Membre validé !", + "copyAddress": "Copier\nl'adresse", + "copy": "Copier", + "thisAddressHasBeenCopiedToClipboard": "Cette adresse a été copié dans votre presse-papier.", + "chooseWalletName": "Choisissez un nouveau nom\npour votre portefeuille :", + "choosePassword": "Choisissez un code secret autogénéré :", + "chooseDerivation": "Choisissez une dérivation:", + "validate": "Valider", + "confirm": "Confirmer", + "confirmPayment": "Confirmer le paiement", + "clickHereToConfirmIdentity": "Cliquez ici pour confirmer\nvotre nouvelle identité" + } \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index b484616..26f6a8b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -45,7 +45,6 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:window_size/window_size.dart'; import 'package:graphql_flutter/graphql_flutter.dart'; -import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:easy_localization/easy_localization.dart'; const bool enableSentry = true; @@ -110,7 +109,7 @@ Future main() async { supportedLocales: const [Locale('en'), Locale('fr')], path: 'assets/translations', // <-- change the path of the translation files - fallbackLocale: const Locale('fr'), + fallbackLocale: const Locale('en'), child: Gecko(indexerEndpoint), ), ), diff --git a/lib/providers/generate_wallets.dart b/lib/providers/generate_wallets.dart index 0d90ec5..cc386b5 100644 --- a/lib/providers/generate_wallets.dart +++ b/lib/providers/generate_wallets.dart @@ -1,6 +1,7 @@ import 'dart:math'; import 'dart:typed_data'; import 'package:durt/durt.dart' as durt; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; @@ -62,9 +63,9 @@ class GenerateWalletsProvider with ChangeNotifier { String chestName; if (chestNumber == 0) { - chestName = 'Coffre à Ğecko'; + chestName = 'geckoChest'.tr(); } else { - chestName = 'Coffre à Ğecko ${chestNumber + 1}'; + chestName = 'geckoChest'.tr() + '${chestNumber + 1}'; } await configBox.put('currentChest', chestNumber); @@ -400,8 +401,8 @@ class GenerateWalletsProvider with ChangeNotifier { if (balance != 0) { isAlive = true; String walletName = scanedWalletNumber == 0 - ? 'Mon portefeuille courant' - : 'Portefeuille ${scanedWalletNumber + 1}'; + ? 'currentWallet'.tr() + : 'wallet'.tr() + ' ${scanedWalletNumber + 1}'; await _sub.importAccount( mnemonic: '', fromMnemonic: true, @@ -437,7 +438,7 @@ class GenerateWalletsProvider with ChangeNotifier { log.d(balance); if (balance != 0) { - String walletName = 'Mon portefeuille racine'; + String walletName = 'myRootWallet'.tr(); await _sub.importAccount( mnemonic: '', fromMnemonic: true, password: pin.text); diff --git a/lib/providers/home.dart b/lib/providers/home.dart index c389b1b..f55af59 100644 --- a/lib/providers/home.dart +++ b/lib/providers/home.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'dart:math'; // import 'package:audioplayers/audio_cache.dart'; // import 'package:audioplayers/audioplayers.dart'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'dart:async'; @@ -25,10 +26,8 @@ class HomeProvider with ChangeNotifier { Icon searchIcon = const Icon(Icons.search); final TextEditingController searchQuery = TextEditingController(); Widget appBarTitle = Text('Ğecko', style: TextStyle(color: Colors.grey[850])); - Widget appBarExplorer = - Text('Explorateur', style: TextStyle(color: Colors.grey[850])); - String homeMessage = "Chargement en cours ..."; - String defaultMessage = "y'a pas de lézard ;-)"; + String homeMessage = "loading".tr(); + String defaultMessage = "noLizard".tr(); Future initHive() async { late Directory hivePath; @@ -211,20 +210,6 @@ class HomeProvider with ChangeNotifier { ); } - void handleSearchEnd() { - searchIcon = Icon( - Icons.search, - color: Colors.grey[850], - ); - appBarTitle = Text('Ğecko', style: TextStyle(color: Colors.grey[850])); - appBarExplorer = - Text('Explorateur', style: TextStyle(color: Colors.grey[850])); - isSearching = false; - searchQuery.clear(); - - notifyListeners(); - } - void rebuildWidget() { notifyListeners(); } diff --git a/lib/providers/substrate_sdk.dart b/lib/providers/substrate_sdk.dart index 27cebf8..93b5cdc 100644 --- a/lib/providers/substrate_sdk.dart +++ b/lib/providers/substrate_sdk.dart @@ -1,5 +1,6 @@ // ignore_for_file: avoid_print +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; @@ -56,7 +57,7 @@ class SubstrateSdk with ChangeNotifier { // _homeProvider.changeMessage("Vous n'êtes pas connecté à internet", 0); // return; // } - _homeProvider.changeMessage("Connexion en cours...", 0); + _homeProvider.changeMessage("connectionPending".tr(), 0); for (String _endpoint in configBox.get('endpoint')) { final n = NetworkParams(); @@ -109,7 +110,7 @@ class SubstrateSdk with ChangeNotifier { // log.d(sdk.api.connectedNode?.endpoint); if (sdk.api.connectedNode?.endpoint == null) { nodeConnected = false; - _homeProvider.changeMessage("Le réseau a été perdu...", 0); + _homeProvider.changeMessage("networkLost".tr(), 0); } else { nodeConnected = true; } @@ -119,14 +120,14 @@ class SubstrateSdk with ChangeNotifier { // currencyName = await getCurencyName(); notifyListeners(); _homeProvider.changeMessage( - 'Vous êtes bien connecté aux noeud\n${getConnectedEndpoint()!.split('/')[2]}', + "wellConnectedToNode".tr(args: [getConnectedEndpoint()!.split('/')[2]]), 5); // snackNode(ctx, true); } else { nodeConnected = false; debugConnection = res.toString(); notifyListeners(); - _homeProvider.changeMessage("Aucun server disponible...", 0); + _homeProvider.changeMessage("noDuniterEndointAvailable".tr(), 0); // snackNode(ctx, false); } diff --git a/lib/providers/wallet_options.dart b/lib/providers/wallet_options.dart index a123809..5a958e7 100644 --- a/lib/providers/wallet_options.dart +++ b/lib/providers/wallet_options.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'dart:async'; import 'package:gecko/globals.dart'; @@ -163,7 +164,7 @@ class WalletOptionsProvider with ChangeNotifier { return isOwner ? InkWell( child: _showText( - 'Cliquez ici pour confirmer\nvotre nouvelle identité', + 'clickHereToConfirmIdentity'.tr(), 18, true), onTap: () async { @@ -190,7 +191,7 @@ class WalletOptionsProvider with ChangeNotifier { case 'Validated': { return isOwner - ? _showText('Membre validé !', 18, true) + ? _showText('memberValidated'.tr(), 18, true) : _duniterIndexer.getNameByAddress( context, address, @@ -263,7 +264,7 @@ class WalletOptionsProvider with ChangeNotifier { return TextButton( key: const Key('infoPopup'), child: Text( - "Valider", + "validate".tr(), style: TextStyle( fontSize: 21, color: idtyName.text.length >= 2 @@ -325,10 +326,10 @@ class WalletOptionsProvider with ChangeNotifier { barrierDismissible: true, builder: (BuildContext context) { return AlertDialog( - title: const Text( - 'Choisissez un nouveau nom\n pour votre portefeuille :', + title: Text( + 'chooseWalletName'.tr(), textAlign: TextAlign.center, - style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500), + style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w500), ), content: SizedBox( height: 100, @@ -352,7 +353,7 @@ class WalletOptionsProvider with ChangeNotifier { return TextButton( key: const Key('infoPopup'), child: Text( - "Valider", + "validate".tr(), style: TextStyle( fontSize: 21, color: canValidateNameBool diff --git a/lib/providers/wallets_profiles.dart b/lib/providers/wallets_profiles.dart index a12817e..1cde68c 100644 --- a/lib/providers/wallets_profiles.dart +++ b/lib/providers/wallets_profiles.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; @@ -235,10 +236,10 @@ Widget headerProfileView( } snackCopyKey(context) { - const snackBar = SnackBar( - padding: EdgeInsets.all(20), - content: Text("Cette adresse a été copié dans votre presse-papier.", - style: TextStyle(fontSize: 16)), - duration: Duration(seconds: 2)); + final snackBar = SnackBar( + padding: const EdgeInsets.all(20), + content: Text("thisAddressHasBeenCopiedToClipboard".tr(), + style: const TextStyle(fontSize: 16)), + duration: const Duration(seconds: 2)); ScaffoldMessenger.of(context).showSnackBar(snackBar); } diff --git a/lib/screens/home.dart b/lib/screens/home.dart index c9899be..4749b07 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -63,7 +63,7 @@ class HomeScreen extends StatelessWidget { ), ListTile( key: const Key('parameters'), - title: const Text('Paramètres'), + title: Text('parameters'.tr()), onTap: () { Navigator.pop(context); Navigator.push( @@ -302,9 +302,8 @@ Widget geckHome(context) { ), ), const SizedBox(height: 12), - const Text('msg').tr(args: [currencyName]), Text( - "Rechercher un\nportefeuille", + "searchWallet".tr(), textAlign: TextAlign.center, style: TextStyle( color: Colors.white, @@ -370,7 +369,7 @@ Widget geckHome(context) { ), const SizedBox(height: 12), Text( - "Gérer mes\nportefeuilles", + "manageWallets".tr(), textAlign: TextAlign.center, style: TextStyle( color: Colors.white, @@ -414,7 +413,7 @@ Widget geckHome(context) { ), const SizedBox(height: 12), Text( - "Scanner un\nQR code", + "scanQRCode".tr(), textAlign: TextAlign.center, style: TextStyle( color: Colors.white, @@ -470,7 +469,7 @@ Widget welcomeHome(context) { child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "L’application de paiement $currencyName\nplus rapide qu’un reptile du Vietnam", + "fastAppDescription".tr(args: [currencyName]), textAlign: TextAlign.center, style: const TextStyle( color: Colors.white, @@ -522,7 +521,7 @@ Widget welcomeHome(context) { ), Positioned( left: 180, - child: bubbleSpeak("y'a pas de lézard !"), + child: bubbleSpeak("noLizard".tr()), ), const Positioned( left: 200, @@ -553,10 +552,10 @@ Widget welcomeHome(context) { ), ); }, - child: const Text( - 'Créer un portefeuille', + child: Text( + 'createWallet'.tr(), style: - TextStyle(fontSize: 24, fontWeight: FontWeight.w600), + const TextStyle(fontSize: 24, fontWeight: FontWeight.w600), ), ), ), @@ -578,7 +577,7 @@ Widget welcomeHome(context) { ); }, child: Text( - "Restaurer mes portefeuilles", + "restoreWallet".tr(), style: TextStyle( fontSize: 24, color: orangeC, diff --git a/lib/screens/myWallets/change_pin.dart b/lib/screens/myWallets/change_pin.dart index 09170ad..3a867a3 100644 --- a/lib/screens/myWallets/change_pin.dart +++ b/lib/screens/myWallets/change_pin.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:durt/durt.dart'; import 'package:flutter/services.dart'; @@ -63,7 +64,7 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier { ), const SizedBox(height: 80), Text( - 'Choisissez un code secret autogénéré :', + 'choosePassword'.tr(), textAlign: TextAlign.center, style: TextStyle( fontSize: 17.0, @@ -126,9 +127,9 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier { Navigator.pop(context); } }, - child: const Text( - 'Confirmer', - style: TextStyle(fontSize: 28), + child: Text( + 'confirm'.tr(), + style: const TextStyle(fontSize: 28), ), ), ) diff --git a/lib/screens/myWallets/chest_options.dart b/lib/screens/myWallets/chest_options.dart index 54e6891..e5c64f9 100644 --- a/lib/screens/myWallets/chest_options.dart +++ b/lib/screens/myWallets/chest_options.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:gecko/globals.dart'; import 'package:gecko/models/chest_data.dart'; @@ -93,7 +94,7 @@ class ChestOptions extends StatelessWidget { ), const SizedBox(width: 15), Text( - 'Afficher ma phrase de restauration', + 'displayMnemonic'.tr(), style: TextStyle( fontSize: 20, color: orangeC, @@ -136,7 +137,7 @@ class ChestOptions extends StatelessWidget { ), const SizedBox(width: 18), Text( - 'Changer mon code secret', + 'changePassword'.tr(), style: TextStyle( fontSize: 20, color: _sub.nodeConnected @@ -172,7 +173,7 @@ class ChestOptions extends StatelessWidget { ), const SizedBox(width: 25), Text( - 'Créer une autre dérivation', + 'createDerivation'.tr(), style: TextStyle( fontSize: 20, color: _sub.nodeConnected @@ -198,9 +199,9 @@ class ChestOptions extends StatelessWidget { height: 45, ), const SizedBox(width: 20), - const Text( - 'Supprimer ce coffre', - style: TextStyle( + Text( + 'deleteChest'.tr(), + style: const TextStyle( fontSize: 20, color: Color(0xffD80000), ), diff --git a/lib/screens/myWallets/choose_chest.dart b/lib/screens/myWallets/choose_chest.dart index de15755..c1c4fa5 100644 --- a/lib/screens/myWallets/choose_chest.dart +++ b/lib/screens/myWallets/choose_chest.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:gecko/providers/my_wallets.dart'; @@ -35,9 +36,9 @@ class _ChooseChestState extends State { backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, - title: const SizedBox( + title: SizedBox( height: 22, - child: Text('Sélectionner mon coffre'), + child: Text('selectMyChest'.tr()), )), body: SafeArea( child: Column(children: [ @@ -140,7 +141,7 @@ class _ChooseChestState extends State { } }, child: Text( - 'Ouvrir ce coffre', + 'openThisChest'.tr(), style: TextStyle( fontSize: 22, color: backgroundColor, @@ -166,7 +167,7 @@ class _ChooseChestState extends State { width: 400, height: 50, child: Center( - child: Text('Créer un nouveau coffre', + child: Text('createChest'.tr(), style: TextStyle( fontSize: 22, color: orangeC, @@ -189,7 +190,7 @@ class _ChooseChestState extends State { width: 400, height: 50, child: Center( - child: Text('Importer un coffre', + child: Text('importChest'.tr(), style: TextStyle( fontSize: 22, color: orangeC, diff --git a/lib/screens/myWallets/choose_wallet.dart b/lib/screens/myWallets/choose_wallet.dart index 917f38f..47d3e84 100644 --- a/lib/screens/myWallets/choose_wallet.dart +++ b/lib/screens/myWallets/choose_wallet.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:flutter/material.dart'; @@ -58,10 +59,10 @@ class ChooseWalletScreen extends StatelessWidget { Navigator.pop(context); Navigator.pop(context); }, - child: const Text( - 'Choisir ce portefeuille', + child: Text( + 'chooseThisWallet'.tr(), style: - TextStyle(fontSize: 24, fontWeight: FontWeight.w600), + const TextStyle(fontSize: 24, fontWeight: FontWeight.w600), ), ), ), diff --git a/lib/screens/myWallets/custom_derivations.dart b/lib/screens/myWallets/custom_derivations.dart index 4ddcd76..bacd1da 100644 --- a/lib/screens/myWallets/custom_derivations.dart +++ b/lib/screens/myWallets/custom_derivations.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:flutter/material.dart'; @@ -50,16 +51,16 @@ class _CustomDerivationState extends State { backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, - title: const SizedBox( + title: SizedBox( height: 22, - child: Text('Créer une dérivation personnalisé'), + child: Text('createCustomDerivation'.tr()), )), body: Center( child: SafeArea( child: Column(children: [ const Spacer(), - const Text( - 'Choisissez une dérivation:', + Text( + 'chooseDerivation'.tr(), ), const SizedBox(height: 20), SizedBox( @@ -125,7 +126,7 @@ class _CustomDerivationState extends State { if (_pin != null || _myWalletProvider.pinCode != '') { String _newDerivationName = - 'Portefeuille ${_myWalletProvider.listWallets.last.number! + 2}'; + 'wallet'.tr() + ' ${_myWalletProvider.listWallets.last.number! + 2}'; if (dropdownValue == 'root') { await _myWalletProvider.generateRootWallet( context, 'Portefeuille racine'); @@ -146,9 +147,9 @@ class _CustomDerivationState extends State { // ); } }, - child: const Text( - 'Valider', - style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600), + child: Text( + 'validate'.tr(), + style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w600), ), ), ), diff --git a/lib/screens/myWallets/manage_membership.dart b/lib/screens/myWallets/manage_membership.dart index 3520a0e..5f4759f 100644 --- a/lib/screens/myWallets/manage_membership.dart +++ b/lib/screens/myWallets/manage_membership.dart @@ -24,7 +24,7 @@ class ManageMembership extends StatelessWidget { toolbarHeight: 60 * ratio, title: const SizedBox( height: 22, - child: Text('Gérer mon adhésion'), + child: Text('manageMembership'), )), body: SafeArea( child: Column(children: [ diff --git a/lib/screens/myWallets/show_seed.dart b/lib/screens/myWallets/show_seed.dart index 276caa4..5bd355a 100644 --- a/lib/screens/myWallets/show_seed.dart +++ b/lib/screens/myWallets/show_seed.dart @@ -1,4 +1,5 @@ import 'dart:typed_data'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:flutter/material.dart'; @@ -97,7 +98,7 @@ class ShowSeed extends StatelessWidget { ), const SizedBox(width: 7), Text( - 'Copier', + 'copy'.tr(), style: TextStyle( fontSize: 15, color: Colors.grey[50]), ) diff --git a/lib/screens/myWallets/transaction_comment.dart b/lib/screens/myWallets/transaction_comment.dart index 7356e1e..3632f65 100644 --- a/lib/screens/myWallets/transaction_comment.dart +++ b/lib/screens/myWallets/transaction_comment.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:flutter/material.dart'; @@ -17,9 +18,9 @@ class TransactionCommentScreen extends StatelessWidget { return Scaffold( appBar: AppBar( toolbarHeight: 60 * ratio, - title: const SizedBox( + title: SizedBox( height: 22, - child: Text('Confirmer le paiement'), + child: Text('confirmPayment'.tr()), ), ), body: SafeArea( diff --git a/lib/screens/myWallets/unlocking_wallet.dart b/lib/screens/myWallets/unlocking_wallet.dart index f7ff92e..346316d 100644 --- a/lib/screens/myWallets/unlocking_wallet.dart +++ b/lib/screens/myWallets/unlocking_wallet.dart @@ -1,6 +1,7 @@ // ignore_for_file: avoid_print import 'dart:async'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:gecko/models/chest_data.dart'; import 'package:gecko/providers/substrate_sdk.dart'; @@ -90,11 +91,11 @@ class UnlockingWallet extends StatelessWidget { )), ]), SizedBox(height: 30 * ratio), - const SizedBox( + SizedBox( width: 400, child: Text( - 'Pour déverrouiller votre coffre, composez votre code secret à l’abri des lézards indiscrets :', - style: TextStyle( + 'toUnlockEnterPassword'.tr(), + style: const TextStyle( fontSize: 19, color: Colors.black, fontWeight: FontWeight.w400), @@ -118,7 +119,7 @@ class UnlockingWallet extends StatelessWidget { ), const SizedBox(width: 8), Text( - 'Garder ce code en mémoire 15 minutes', + 'rememberPassword'.tr(), style: TextStyle( fontSize: 16, color: Colors.grey[700]), ), @@ -142,7 +143,7 @@ class UnlockingWallet extends StatelessWidget { height: 50, child: Center( child: Text( - 'Changer de coffre', + 'changeChest'.tr(), style: TextStyle( fontSize: 22, color: orangeC, diff --git a/lib/screens/myWallets/wallet_options.dart b/lib/screens/myWallets/wallet_options.dart index 8e0465e..69cfe1d 100644 --- a/lib/screens/myWallets/wallet_options.dart +++ b/lib/screens/myWallets/wallet_options.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:io'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:gecko/globals.dart'; import 'package:gecko/providers/duniter_indexer.dart'; @@ -306,7 +307,7 @@ class WalletOptions extends StatelessWidget { ), const SizedBox(width: 7), Text( - 'Copier', + 'copy'.tr(), style: TextStyle(fontSize: 15, color: Colors.grey[50]), ) ]), @@ -351,8 +352,8 @@ class WalletOptions extends StatelessWidget { height: 45, ), const SizedBox(width: 22), - const Text("Voir l'activité", - style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500)), + Text("displayActivity".tr(), + style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w500)), ]), ), ); @@ -382,7 +383,7 @@ class WalletOptions extends StatelessWidget { height: 45, ), const SizedBox(width: 22), - const Text('Gérer mon adhésion', style: TextStyle(fontSize: 20)), + Text('manageMembership'.tr(), style: const TextStyle(fontSize: 20)), ]), ), ); @@ -420,8 +421,8 @@ class WalletOptions extends StatelessWidget { const SizedBox(width: 22), Text( walletProvider.isDefaultWallet - ? 'Ce portefeuille est celui par defaut' - : 'Définir comme portefeuille par défaut', + ? 'thisWalletIsDefault'.tr() + : 'defineWalletAsDefault'.tr(), style: TextStyle( fontSize: 20, color: walletProvider.isDefaultWallet diff --git a/lib/screens/myWallets/wallets_home.dart b/lib/screens/myWallets/wallets_home.dart index e1b2a79..fa264d8 100644 --- a/lib/screens/myWallets/wallets_home.dart +++ b/lib/screens/myWallets/wallets_home.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:gecko/models/chest_data.dart'; @@ -97,9 +98,9 @@ class WalletsHome extends StatelessWidget { return ChestOptions(walletProvider: _myWalletProvider); }), ), - label: const Text( - " Paramétrer ce coffre", - style: TextStyle( + label: Text( + " " + "manageChest".tr(), + style: const TextStyle( fontSize: 22, fontWeight: FontWeight.w700, color: Color(0xff8a3c0f), @@ -108,7 +109,7 @@ class WalletsHome extends StatelessWidget { )), const SizedBox(height: 30), InkWell( - key: const Key('createNewChest'), + key: const Key('changeChest'), onTap: () { Navigator.push( context, @@ -121,7 +122,7 @@ class WalletsHome extends StatelessWidget { width: 400, height: 50, child: Center( - child: Text('Changer de coffre', + child: Text('changeChest'.tr(), style: TextStyle( fontSize: 22, color: orangeC, @@ -360,7 +361,7 @@ class WalletsHome extends StatelessWidget { Provider.of(context); String _newDerivationName = - 'Portefeuille ${_myWalletProvider.listWallets.last.number! + 2}'; + 'wallet'.tr() + ' ${_myWalletProvider.listWallets.last.number! + 2}'; return Padding( padding: const EdgeInsets.all(16), child: ClipRRect( diff --git a/lib/screens/onBoarding/10.dart b/lib/screens/onBoarding/10.dart index b06ba94..7b321c6 100644 --- a/lib/screens/onBoarding/10.dart +++ b/lib/screens/onBoarding/10.dart @@ -1,6 +1,7 @@ // ignore_for_file: file_names import 'dart:async'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/globals.dart'; @@ -206,7 +207,7 @@ class OnboardingStepTen extends StatelessWidget { chest: configBox.get('currentChest'), address: address, number: 0, - name: 'Mon portefeuille courant', + name: 'currentWallet'.tr(), derivation: 2, imageDefaultPath: '0.png'); await walletBox.add(myWallet); diff --git a/lib/screens/onBoarding/11_congratulations.dart b/lib/screens/onBoarding/11_congratulations.dart index 4c88d39..cd92ba5 100644 --- a/lib/screens/onBoarding/11_congratulations.dart +++ b/lib/screens/onBoarding/11_congratulations.dart @@ -1,5 +1,6 @@ // ignore_for_file: file_names +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/globals.dart'; @@ -73,7 +74,7 @@ Widget finishButton(BuildContext context) { ModalRoute.withName('/'), ); }, - child: Text("Accéder à mon coffre", + child: Text("accessMyChest".tr(), style: TextStyle(fontSize: 22 * ratio, fontWeight: FontWeight.w600))), ); diff --git a/lib/screens/onBoarding/3.dart b/lib/screens/onBoarding/3.dart index 42bd197..48cf981 100644 --- a/lib/screens/onBoarding/3.dart +++ b/lib/screens/onBoarding/3.dart @@ -1,5 +1,6 @@ // ignore_for_file: file_names +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/globals.dart'; @@ -31,11 +32,11 @@ class OnboardingStepThree extends StatelessWidget { child: common.infoIntro( context, [ - const TextSpan( + TextSpan( text: - 'Dans une blockchain, pas de procédure de récupération par mail. Seule votre phrase de restauration peut vous permettre de récupérer vos Ğ1 à tout moment.'), + 'warningForgotPassword'.tr()), ], - 'mot-de-passe-oublie.png', + 'forgot_password.png'.tr(), '>', const OnboardingStepFor(), 2), diff --git a/lib/screens/onBoarding/5.dart b/lib/screens/onBoarding/5.dart index 596d1b2..266234b 100644 --- a/lib/screens/onBoarding/5.dart +++ b/lib/screens/onBoarding/5.dart @@ -1,5 +1,6 @@ // ignore_for_file: file_names +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/globals.dart'; @@ -93,7 +94,8 @@ class _ChooseChestState extends State { // _generateWalletProvider.reloadBuild(); setState(() {}); }, - child: Text("Choisir une autre phrase", + child: Text("chooseAnotherMnemonic".tr(), + textAlign: TextAlign.center, style: TextStyle( fontSize: 22 * ratio, fontWeight: FontWeight.w600))), @@ -101,7 +103,7 @@ class _ChooseChestState extends State { ), ), SizedBox(height: 22 * ratio), - nextButton(context, "J'ai noté ma phrase", false, widget.skipIntro), + nextButton(context, "iNotedMyMnemonic".tr(), false, widget.skipIntro), SizedBox(height: 35 * ratio), ]), ), @@ -204,7 +206,7 @@ class PrintWallet extends StatelessWidget { title: const SizedBox( height: 22, child: Text( - 'Imprimer ma phrase de restauration', + 'printMyMnemonic', style: TextStyle(fontWeight: FontWeight.w600), ), ), diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index bccf4d4..4fb67cb 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:durt/durt.dart'; import 'package:flutter/services.dart'; @@ -39,9 +40,9 @@ class SettingsScreen extends StatelessWidget { backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, - title: const SizedBox( + title: SizedBox( height: 22, - child: Text('Paramètres'), + child: Text('parameters'.tr()), )), body: Column( // crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/wallet_view.dart b/lib/screens/wallet_view.dart index f69cbd3..0044bc6 100644 --- a/lib/screens/wallet_view.dart +++ b/lib/screens/wallet_view.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:flutter/material.dart'; @@ -321,7 +322,7 @@ class WalletViewScreen extends StatelessWidget { ), const SizedBox(height: 9), Text( - "Copier\nla clef", + "copyAddress".tr(), textAlign: TextAlign.center, style: TextStyle( fontSize: buttonFontSize, fontWeight: FontWeight.w500), diff --git a/pubspec.lock b/pubspec.lock index 85ce7e4..113d714 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -274,6 +274,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.1" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.2" dart_style: dependency: transitive description: @@ -389,6 +396,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.18.4" + flutter_html: + dependency: "direct main" + description: + name: flutter_html + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0-alpha.5" flutter_inappwebview: dependency: transitive description: @@ -570,6 +584,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.3" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.15.0" http: dependency: "direct main" description: @@ -827,6 +848,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.6.0+1" + numerus: + dependency: transitive + description: + name: numerus + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" package_config: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b6077d7..ab75df1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -73,6 +73,7 @@ dependencies: connectivity_plus: ^2.3.3 image_cropper: ^2.0.3 easy_localization: ^3.0.1 + flutter_html: ^3.0.0-alpha.5 dev_dependencies: # flutter_launcher_icons: ^0.9.2 diff --git a/test_driver/app_test.dart b/test_driver/app_test.dart index 40ba8d5..43b6910 100644 --- a/test_driver/app_test.dart +++ b/test_driver/app_test.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:io'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter_driver/flutter_driver.dart'; import 'package:test/test.dart'; // import 'package:flutter/services.dart'; @@ -255,7 +256,7 @@ void main() { {timeout = const Duration(seconds: 2)}) async { await tapOn('goWalletHome'); - expect(await getText('myWallets'), "Coffre à Ğecko"); + expect(await getText('myWallets'), "geckoChest".tr()); await sleep(300); // Go to first derivation and rename it