mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 09:29:48 +00:00
Adding seed languages for France and Italy for Monero New-Wallet and Monero Restore-Wallet
This commit is contained in:
parent
22d285966d
commit
f3eca2be1c
21 changed files with 121 additions and 87 deletions
BIN
assets/images/france.png
Normal file
BIN
assets/images/france.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 KiB |
BIN
assets/images/italy.png
Normal file
BIN
assets/images/italy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 KiB |
|
@ -3,6 +3,7 @@ import 'package:cw_monero/api/transaction_history.dart'
|
||||||
as monero_transaction_history;
|
as monero_transaction_history;
|
||||||
import 'package:cw_core/crypto_currency.dart';
|
import 'package:cw_core/crypto_currency.dart';
|
||||||
import 'package:cake_wallet/core/amount_converter.dart';
|
import 'package:cake_wallet/core/amount_converter.dart';
|
||||||
|
|
||||||
import 'package:cw_core/pending_transaction.dart';
|
import 'package:cw_core/pending_transaction.dart';
|
||||||
|
|
||||||
class DoubleSpendException implements Exception {
|
class DoubleSpendException implements Exception {
|
||||||
|
|
|
@ -24,15 +24,17 @@ class NewWalletPage extends BasePage {
|
||||||
final walletNameImage = Image.asset('assets/images/wallet_name.png');
|
final walletNameImage = Image.asset('assets/images/wallet_name.png');
|
||||||
|
|
||||||
final walletNameLightImage =
|
final walletNameLightImage =
|
||||||
Image.asset('assets/images/wallet_name_light.png');
|
Image.asset('assets/images/wallet_name_light.png');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get title => S.current.new_wallet;
|
String get title => S.current.new_wallet;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) => WalletNameForm(_walletNewVM,
|
Widget body(BuildContext context) => WalletNameForm(
|
||||||
|
_walletNewVM,
|
||||||
currentTheme.type == ThemeType.dark
|
currentTheme.type == ThemeType.dark
|
||||||
? walletNameImage : walletNameLightImage);
|
? walletNameImage
|
||||||
|
: walletNameLightImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
class WalletNameForm extends StatefulWidget {
|
class WalletNameForm extends StatefulWidget {
|
||||||
|
@ -60,7 +62,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||||
_stateReaction ??=
|
_stateReaction ??=
|
||||||
reaction((_) => _walletNewVM.state, (ExecutionState state) {
|
reaction((_) => _walletNewVM.state, (ExecutionState state) {
|
||||||
if (state is ExecutedSuccessfullyState) {
|
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) {
|
if (state is FailureState) {
|
||||||
|
@ -92,7 +95,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||||
padding: EdgeInsets.only(left: 12, right: 12),
|
padding: EdgeInsets.only(left: 12, right: 12),
|
||||||
child: AspectRatio(
|
child: AspectRatio(
|
||||||
aspectRatio: aspectRatioImage,
|
aspectRatio: aspectRatioImage,
|
||||||
child: FittedBox(child: widget.walletImage, fit: BoxFit.fill)),
|
child:
|
||||||
|
FittedBox(child: widget.walletImage, fit: BoxFit.fill)),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: 24),
|
padding: EdgeInsets.only(top: 24),
|
||||||
|
|
|
@ -15,6 +15,8 @@ List<Image> flagImages = [
|
||||||
Image.asset('assets/images/portugal.png'),
|
Image.asset('assets/images/portugal.png'),
|
||||||
Image.asset('assets/images/russia.png'),
|
Image.asset('assets/images/russia.png'),
|
||||||
Image.asset('assets/images/spain.png'),
|
Image.asset('assets/images/spain.png'),
|
||||||
|
Image.asset('assets/images/france.png'),
|
||||||
|
Image.asset('assets/images/italy.png'),
|
||||||
];
|
];
|
||||||
|
|
||||||
const List<String> languageCodes = [
|
const List<String> languageCodes = [
|
||||||
|
@ -26,6 +28,8 @@ const List<String> languageCodes = [
|
||||||
'Por',
|
'Por',
|
||||||
'Rus',
|
'Rus',
|
||||||
'Esp',
|
'Esp',
|
||||||
|
'Fre',
|
||||||
|
'Ita',
|
||||||
];
|
];
|
||||||
|
|
||||||
const defaultSeedLanguage = 'English';
|
const defaultSeedLanguage = 'English';
|
||||||
|
@ -38,7 +42,9 @@ const List<String> seedLanguages = [
|
||||||
'Japanese',
|
'Japanese',
|
||||||
'Portuguese',
|
'Portuguese',
|
||||||
'Russian',
|
'Russian',
|
||||||
'Spanish'
|
'Spanish',
|
||||||
|
'French',
|
||||||
|
'Italian',
|
||||||
];
|
];
|
||||||
|
|
||||||
enum Places { topLeft, topRight, bottomLeft, bottomRight, inside }
|
enum Places { topLeft, topRight, bottomLeft, bottomRight, inside }
|
||||||
|
@ -64,86 +70,80 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertBackground(
|
return AlertBackground(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Column(
|
Container(
|
||||||
mainAxisSize: MainAxisSize.min,
|
padding: EdgeInsets.only(left: 24, right: 24),
|
||||||
children: <Widget>[
|
child: Text(
|
||||||
Container(
|
S.of(context).seed_choose,
|
||||||
padding: EdgeInsets.only(left: 24, right: 24),
|
textAlign: TextAlign.center,
|
||||||
child: Text(
|
style: TextStyle(
|
||||||
S.of(context).seed_choose,
|
fontSize: 18,
|
||||||
textAlign: TextAlign.center,
|
fontWeight: FontWeight.bold,
|
||||||
style: TextStyle(
|
fontFamily: 'Lato',
|
||||||
fontSize: 18,
|
decoration: TextDecoration.none,
|
||||||
fontWeight: FontWeight.bold,
|
color: Colors.white),
|
||||||
fontFamily: 'Lato',
|
),
|
||||||
decoration: TextDecoration.none,
|
),
|
||||||
color: Colors.white
|
Padding(
|
||||||
),
|
padding: EdgeInsets.only(top: 24),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||||
|
child: Container(
|
||||||
|
height: 300,
|
||||||
|
width: 300,
|
||||||
|
color:
|
||||||
|
Theme.of(context).accentTextTheme.title.backgroundColor,
|
||||||
|
child: GridView.count(
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
shrinkWrap: true,
|
||||||
|
crossAxisCount: 3,
|
||||||
|
childAspectRatio: 4 / 3,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
crossAxisSpacing: 1,
|
||||||
|
mainAxisSpacing: 1,
|
||||||
|
children: List.generate(11, (index) {
|
||||||
|
if (index == 10) {
|
||||||
|
return gridTile(
|
||||||
|
isCurrent: false,
|
||||||
|
image: null,
|
||||||
|
text: '',
|
||||||
|
onTap: null);
|
||||||
|
}
|
||||||
|
|
||||||
|
final code = languageCodes[index];
|
||||||
|
final flag = flagImages[index];
|
||||||
|
final isCurrent =
|
||||||
|
index == seedLanguages.indexOf(selected);
|
||||||
|
|
||||||
|
return gridTile(
|
||||||
|
isCurrent: isCurrent,
|
||||||
|
image: flag,
|
||||||
|
text: code,
|
||||||
|
onTap: () {
|
||||||
|
selected = seedLanguages[index];
|
||||||
|
Navigator.of(context).pop(selected);
|
||||||
|
});
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
),
|
||||||
padding: EdgeInsets.only(top: 24),
|
)
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
|
||||||
child: Container(
|
|
||||||
height: 300,
|
|
||||||
width: 300,
|
|
||||||
color: Theme.of(context).accentTextTheme.title.backgroundColor,
|
|
||||||
child: GridView.count(
|
|
||||||
padding: EdgeInsets.all(0),
|
|
||||||
shrinkWrap: true,
|
|
||||||
crossAxisCount: 3,
|
|
||||||
childAspectRatio: 1,
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
crossAxisSpacing: 1,
|
|
||||||
mainAxisSpacing: 1,
|
|
||||||
children: List.generate(9, (index) {
|
|
||||||
|
|
||||||
if (index == 8) {
|
|
||||||
|
|
||||||
return gridTile(
|
|
||||||
isCurrent: false,
|
|
||||||
image: null,
|
|
||||||
text: '',
|
|
||||||
onTap: null);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
final code = languageCodes[index];
|
|
||||||
final flag = flagImages[index];
|
|
||||||
final isCurrent =
|
|
||||||
index == seedLanguages.indexOf(selected);
|
|
||||||
|
|
||||||
return gridTile(
|
|
||||||
isCurrent: isCurrent,
|
|
||||||
image: flag,
|
|
||||||
text: code,
|
|
||||||
onTap: () {
|
|
||||||
selected = seedLanguages[index];
|
|
||||||
Navigator.of(context).pop(selected);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
AlertCloseButton(image: closeButton)
|
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
);
|
AlertCloseButton(image: closeButton)
|
||||||
|
],
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget gridTile({
|
Widget gridTile(
|
||||||
@required bool isCurrent,
|
{@required bool isCurrent,
|
||||||
@required Image image,
|
@required Image image,
|
||||||
@required String text,
|
@required String text,
|
||||||
@required VoidCallback onTap}) {
|
@required VoidCallback onTap}) {
|
||||||
|
|
||||||
final color = isCurrent
|
final color = isCurrent
|
||||||
? Theme.of(context).textTheme.body2.color
|
? Theme.of(context).textTheme.body2.color
|
||||||
: Theme.of(context).accentTextTheme.title.color;
|
: Theme.of(context).accentTextTheme.title.color;
|
||||||
|
@ -174,14 +174,12 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> {
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
decoration: TextDecoration.none,
|
decoration: TextDecoration.none,
|
||||||
color: textColor
|
color: textColor),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,9 @@ class SeedLanguageSelectorState extends State<SeedLanguageSelector> {
|
||||||
S.current.seed_language_japanese,
|
S.current.seed_language_japanese,
|
||||||
S.current.seed_language_portuguese,
|
S.current.seed_language_portuguese,
|
||||||
S.current.seed_language_russian,
|
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;
|
String selected;
|
||||||
final _pickerKey = GlobalKey<SeedLanguagePickerState>();
|
final _pickerKey = GlobalKey<SeedLanguagePickerState>();
|
||||||
|
|
|
@ -7,4 +7,6 @@ class LanguageList {
|
||||||
static const portuguese = 'Portuguese';
|
static const portuguese = 'Portuguese';
|
||||||
static const russian = 'Russian';
|
static const russian = 'Russian';
|
||||||
static const spanish = 'Spanish';
|
static const spanish = 'Spanish';
|
||||||
}
|
// static const french = 'French';
|
||||||
|
// static const italian = 'Italian';
|
||||||
|
}
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "Portugiesisch",
|
"seed_language_portuguese" : "Portugiesisch",
|
||||||
"seed_language_russian" : "Russisch",
|
"seed_language_russian" : "Russisch",
|
||||||
"seed_language_spanish" : "Spanisch",
|
"seed_language_spanish" : "Spanisch",
|
||||||
|
"seed_language_french": "Französisch",
|
||||||
|
"seed_language_italian": "Italiana/Italiano",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "Senden",
|
"send_title" : "Senden",
|
||||||
|
|
|
@ -196,6 +196,8 @@
|
||||||
"seed_language_portuguese" : "Portuguese",
|
"seed_language_portuguese" : "Portuguese",
|
||||||
"seed_language_russian" : "Russian",
|
"seed_language_russian" : "Russian",
|
||||||
"seed_language_spanish" : "Spanish",
|
"seed_language_spanish" : "Spanish",
|
||||||
|
"seed_language_french": "French",
|
||||||
|
"seed_language_italian": "Italian",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "Send",
|
"send_title" : "Send",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "Portugués",
|
"seed_language_portuguese" : "Portugués",
|
||||||
"seed_language_russian" : "Ruso",
|
"seed_language_russian" : "Ruso",
|
||||||
"seed_language_spanish" : "Español",
|
"seed_language_spanish" : "Español",
|
||||||
|
"seed_language_french": "Francesa/Francés",
|
||||||
|
"seed_language_italian": "Italiana/Italiano",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "Enviar",
|
"send_title" : "Enviar",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "पुर्तगाली",
|
"seed_language_portuguese" : "पुर्तगाली",
|
||||||
"seed_language_russian" : "रूसी",
|
"seed_language_russian" : "रूसी",
|
||||||
"seed_language_spanish" : "स्पेनिश",
|
"seed_language_spanish" : "स्पेनिश",
|
||||||
|
"seed_language_french": "फ्रेंच",
|
||||||
|
"seed_language_italian": "इतालवी",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "संदेश",
|
"send_title" : "संदेश",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "Portugalski",
|
"seed_language_portuguese" : "Portugalski",
|
||||||
"seed_language_russian" : "Ruski",
|
"seed_language_russian" : "Ruski",
|
||||||
"seed_language_spanish" : "Španjolski",
|
"seed_language_spanish" : "Španjolski",
|
||||||
|
"seed_language_french": "Francuski",
|
||||||
|
"seed_language_italian": "Talijanski",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "Pošalji",
|
"send_title" : "Pošalji",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "Portoghese",
|
"seed_language_portuguese" : "Portoghese",
|
||||||
"seed_language_russian" : "Russo",
|
"seed_language_russian" : "Russo",
|
||||||
"seed_language_spanish" : "Spagnolo",
|
"seed_language_spanish" : "Spagnolo",
|
||||||
|
"seed_language_french": "Francese",
|
||||||
|
"seed_language_italian": "Italiana/Italiano",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "Invia",
|
"send_title" : "Invia",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "ポルトガル語",
|
"seed_language_portuguese" : "ポルトガル語",
|
||||||
"seed_language_russian" : "ロシア",
|
"seed_language_russian" : "ロシア",
|
||||||
"seed_language_spanish" : "スペイン語",
|
"seed_language_spanish" : "スペイン語",
|
||||||
|
"seed_language_french": "フランス語",
|
||||||
|
"seed_language_italian": "イタリア語",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "を送信",
|
"send_title" : "を送信",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "포르투갈 인",
|
"seed_language_portuguese" : "포르투갈 인",
|
||||||
"seed_language_russian" : "러시아인",
|
"seed_language_russian" : "러시아인",
|
||||||
"seed_language_spanish" : "스페인의",
|
"seed_language_spanish" : "스페인의",
|
||||||
|
"seed_language_french": "프랑스 국민",
|
||||||
|
"seed_language_italian": "이탈리아 사람",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "보내다",
|
"send_title" : "보내다",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "Portugees",
|
"seed_language_portuguese" : "Portugees",
|
||||||
"seed_language_russian" : "Russisch",
|
"seed_language_russian" : "Russisch",
|
||||||
"seed_language_spanish" : "Spaans",
|
"seed_language_spanish" : "Spaans",
|
||||||
|
"seed_language_french": "Frans",
|
||||||
|
"seed_language_italian": "Italiaans",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "Stuur",
|
"send_title" : "Stuur",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "Portugalski",
|
"seed_language_portuguese" : "Portugalski",
|
||||||
"seed_language_russian" : "Rosyjski",
|
"seed_language_russian" : "Rosyjski",
|
||||||
"seed_language_spanish" : "Hiszpański",
|
"seed_language_spanish" : "Hiszpański",
|
||||||
|
"seed_language_french": "Francuski",
|
||||||
|
"seed_language_italian": "Włoski",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "Wyślij",
|
"send_title" : "Wyślij",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "Português",
|
"seed_language_portuguese" : "Português",
|
||||||
"seed_language_russian" : "Russa",
|
"seed_language_russian" : "Russa",
|
||||||
"seed_language_spanish" : "Espanhola",
|
"seed_language_spanish" : "Espanhola",
|
||||||
|
"seed_language_french": "Francesa/Francês",
|
||||||
|
"seed_language_italian": "Italiana/Italiano",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "Enviar",
|
"send_title" : "Enviar",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "Португальский",
|
"seed_language_portuguese" : "Португальский",
|
||||||
"seed_language_russian" : "Русский",
|
"seed_language_russian" : "Русский",
|
||||||
"seed_language_spanish" : "Испанский",
|
"seed_language_spanish" : "Испанский",
|
||||||
|
"seed_language_french": "Французский",
|
||||||
|
"seed_language_italian": "итальянский",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "Отправить",
|
"send_title" : "Отправить",
|
||||||
|
|
|
@ -195,7 +195,8 @@
|
||||||
"seed_language_portuguese" : "Португальська",
|
"seed_language_portuguese" : "Португальська",
|
||||||
"seed_language_russian" : "Російська",
|
"seed_language_russian" : "Російська",
|
||||||
"seed_language_spanish" : "Іспанська",
|
"seed_language_spanish" : "Іспанська",
|
||||||
|
"seed_language_french": "французький",
|
||||||
|
"seed_language_italian": "італійська",
|
||||||
|
|
||||||
"send_title" : "Відправити",
|
"send_title" : "Відправити",
|
||||||
"send_your_wallet" : "Ваш гаманець",
|
"send_your_wallet" : "Ваш гаманець",
|
||||||
|
|
|
@ -195,6 +195,8 @@
|
||||||
"seed_language_portuguese" : "葡萄牙文",
|
"seed_language_portuguese" : "葡萄牙文",
|
||||||
"seed_language_russian" : "俄文",
|
"seed_language_russian" : "俄文",
|
||||||
"seed_language_spanish" : "西班牙文",
|
"seed_language_spanish" : "西班牙文",
|
||||||
|
"seed_language_french": "法语",
|
||||||
|
"seed_language_italian": "意大利语",
|
||||||
|
|
||||||
|
|
||||||
"send_title" : "发送",
|
"send_title" : "发送",
|
||||||
|
|
Loading…
Reference in a new issue