Adding seed languages for France and Italy for Monero New-Wallet and Monero Restore-Wallet

This commit is contained in:
RafiaChy 2022-01-17 21:46:49 +06:00
parent 22d285966d
commit f3eca2be1c
21 changed files with 121 additions and 87 deletions

BIN
assets/images/france.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

BIN
assets/images/italy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -3,6 +3,7 @@ import 'package:cw_monero/api/transaction_history.dart'
as monero_transaction_history;
import 'package:cw_core/crypto_currency.dart';
import 'package:cake_wallet/core/amount_converter.dart';
import 'package:cw_core/pending_transaction.dart';
class DoubleSpendException implements Exception {

View file

@ -30,9 +30,11 @@ class NewWalletPage extends BasePage {
String get title => S.current.new_wallet;
@override
Widget body(BuildContext context) => WalletNameForm(_walletNewVM,
Widget body(BuildContext context) => WalletNameForm(
_walletNewVM,
currentTheme.type == ThemeType.dark
? walletNameImage : walletNameLightImage);
? walletNameImage
: walletNameLightImage);
}
class WalletNameForm extends StatefulWidget {
@ -60,7 +62,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
_stateReaction ??=
reaction((_) => _walletNewVM.state, (ExecutionState state) {
if (state is ExecutedSuccessfullyState) {
Navigator.of(context).pushNamed(Routes.preSeed, arguments: _walletNewVM.type);
Navigator.of(context)
.pushNamed(Routes.preSeed, arguments: _walletNewVM.type);
}
if (state is FailureState) {
@ -92,7 +95,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
padding: EdgeInsets.only(left: 12, right: 12),
child: AspectRatio(
aspectRatio: aspectRatioImage,
child: FittedBox(child: widget.walletImage, fit: BoxFit.fill)),
child:
FittedBox(child: widget.walletImage, fit: BoxFit.fill)),
),
Padding(
padding: EdgeInsets.only(top: 24),

View file

@ -15,6 +15,8 @@ List<Image> flagImages = [
Image.asset('assets/images/portugal.png'),
Image.asset('assets/images/russia.png'),
Image.asset('assets/images/spain.png'),
Image.asset('assets/images/france.png'),
Image.asset('assets/images/italy.png'),
];
const List<String> languageCodes = [
@ -26,6 +28,8 @@ const List<String> languageCodes = [
'Por',
'Rus',
'Esp',
'Fre',
'Ita',
];
const defaultSeedLanguage = 'English';
@ -38,7 +42,9 @@ const List<String> seedLanguages = [
'Japanese',
'Portuguese',
'Russian',
'Spanish'
'Spanish',
'French',
'Italian',
];
enum Places { topLeft, topRight, bottomLeft, bottomRight, inside }
@ -79,8 +85,7 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> {
fontWeight: FontWeight.bold,
fontFamily: 'Lato',
decoration: TextDecoration.none,
color: Colors.white
),
color: Colors.white),
),
),
Padding(
@ -90,25 +95,23 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> {
child: Container(
height: 300,
width: 300,
color: Theme.of(context).accentTextTheme.title.backgroundColor,
color:
Theme.of(context).accentTextTheme.title.backgroundColor,
child: GridView.count(
padding: EdgeInsets.all(0),
shrinkWrap: true,
crossAxisCount: 3,
childAspectRatio: 1,
childAspectRatio: 4 / 3,
physics: const NeverScrollableScrollPhysics(),
crossAxisSpacing: 1,
mainAxisSpacing: 1,
children: List.generate(9, (index) {
if (index == 8) {
children: List.generate(11, (index) {
if (index == 10) {
return gridTile(
isCurrent: false,
image: null,
text: '',
onTap: null);
}
final code = languageCodes[index];
@ -123,8 +126,7 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> {
onTap: () {
selected = seedLanguages[index];
Navigator.of(context).pop(selected);
}
);
});
}),
),
),
@ -134,16 +136,14 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> {
),
AlertCloseButton(image: closeButton)
],
)
);
));
}
Widget gridTile({
@required bool isCurrent,
Widget gridTile(
{@required bool isCurrent,
@required Image image,
@required String text,
@required VoidCallback onTap}) {
final color = isCurrent
? Theme.of(context).textTheme.body2.color
: Theme.of(context).accentTextTheme.title.color;
@ -174,14 +174,12 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> {
fontWeight: FontWeight.w600,
fontFamily: 'Lato',
decoration: TextDecoration.none,
color: textColor
),
color: textColor),
),
)
],
),
),
)
);
));
}
}

View file

@ -25,7 +25,9 @@ class SeedLanguageSelectorState extends State<SeedLanguageSelector> {
S.current.seed_language_japanese,
S.current.seed_language_portuguese,
S.current.seed_language_russian,
S.current.seed_language_spanish
S.current.seed_language_spanish,
S.current.seed_language_french,
S.current.seed_language_italian,
];
String selected;
final _pickerKey = GlobalKey<SeedLanguagePickerState>();

View file

@ -7,4 +7,6 @@ class LanguageList {
static const portuguese = 'Portuguese';
static const russian = 'Russian';
static const spanish = 'Spanish';
// static const french = 'French';
// static const italian = 'Italian';
}

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "Portugiesisch",
"seed_language_russian" : "Russisch",
"seed_language_spanish" : "Spanisch",
"seed_language_french": "Französisch",
"seed_language_italian": "Italiana/Italiano",
"send_title" : "Senden",

View file

@ -196,6 +196,8 @@
"seed_language_portuguese" : "Portuguese",
"seed_language_russian" : "Russian",
"seed_language_spanish" : "Spanish",
"seed_language_french": "French",
"seed_language_italian": "Italian",
"send_title" : "Send",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "Portugués",
"seed_language_russian" : "Ruso",
"seed_language_spanish" : "Español",
"seed_language_french": "Francesa/Francés",
"seed_language_italian": "Italiana/Italiano",
"send_title" : "Enviar",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "पुर्तगाली",
"seed_language_russian" : "रूसी",
"seed_language_spanish" : "स्पेनिश",
"seed_language_french": "फ्रेंच",
"seed_language_italian": "इतालवी",
"send_title" : "संदेश",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "Portugalski",
"seed_language_russian" : "Ruski",
"seed_language_spanish" : "Španjolski",
"seed_language_french": "Francuski",
"seed_language_italian": "Talijanski",
"send_title" : "Pošalji",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "Portoghese",
"seed_language_russian" : "Russo",
"seed_language_spanish" : "Spagnolo",
"seed_language_french": "Francese",
"seed_language_italian": "Italiana/Italiano",
"send_title" : "Invia",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "ポルトガル語",
"seed_language_russian" : "ロシア",
"seed_language_spanish" : "スペイン語",
"seed_language_french": "フランス語",
"seed_language_italian": "イタリア語",
"send_title" : "を送信",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "포르투갈 인",
"seed_language_russian" : "러시아인",
"seed_language_spanish" : "스페인의",
"seed_language_french": "프랑스 국민",
"seed_language_italian": "이탈리아 사람",
"send_title" : "보내다",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "Portugees",
"seed_language_russian" : "Russisch",
"seed_language_spanish" : "Spaans",
"seed_language_french": "Frans",
"seed_language_italian": "Italiaans",
"send_title" : "Stuur",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "Portugalski",
"seed_language_russian" : "Rosyjski",
"seed_language_spanish" : "Hiszpański",
"seed_language_french": "Francuski",
"seed_language_italian": "Włoski",
"send_title" : "Wyślij",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "Português",
"seed_language_russian" : "Russa",
"seed_language_spanish" : "Espanhola",
"seed_language_french": "Francesa/Francês",
"seed_language_italian": "Italiana/Italiano",
"send_title" : "Enviar",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "Португальский",
"seed_language_russian" : "Русский",
"seed_language_spanish" : "Испанский",
"seed_language_french": "Французский",
"seed_language_italian": "итальянский",
"send_title" : "Отправить",

View file

@ -195,7 +195,8 @@
"seed_language_portuguese" : "Португальська",
"seed_language_russian" : "Російська",
"seed_language_spanish" : "Іспанська",
"seed_language_french": "французький",
"seed_language_italian": "італійська",
"send_title" : "Відправити",
"send_your_wallet" : "Ваш гаманець",

View file

@ -195,6 +195,8 @@
"seed_language_portuguese" : "葡萄牙文",
"seed_language_russian" : "俄文",
"seed_language_spanish" : "西班牙文",
"seed_language_french": "法语",
"seed_language_italian": "意大利语",
"send_title" : "发送",