Added Localizations and ran small fixes

This commit is contained in:
Arseni
2025-11-25 08:20:09 +03:00
parent 72d8da1fe8
commit fcb5ab4f2c
41 changed files with 444 additions and 233 deletions

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class BalanceAddFunds extends StatelessWidget {
final VoidCallback onTopUp;
@@ -19,6 +21,7 @@ class BalanceAddFunds extends StatelessWidget {
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;
final colorScheme = Theme.of(context).colorScheme;
final loc = AppLocalizations.of(context)!;
return InkWell(
onTap: onTopUp,
@@ -37,7 +40,7 @@ class BalanceAddFunds extends StatelessWidget {
),
const SizedBox(width: _spacingMedium),
Text(
'Add funds',
loc.addFunds,
style: textTheme.bodyMedium?.copyWith(
color: colorScheme.primary,
fontWeight: FontWeight.w500,

View File

@@ -5,6 +5,8 @@ import 'package:provider/provider.dart';
import 'package:pweb/pages/dashboard/buttons/balance/carousel.dart';
import 'package:pweb/providers/wallets.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class BalanceWidget extends StatelessWidget {
const BalanceWidget({super.key});
@@ -12,6 +14,7 @@ class BalanceWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final walletsProvider = context.watch<WalletsProvider>();
final loc = AppLocalizations.of(context)!;
if (walletsProvider.isLoading) {
return const Center(child: CircularProgressIndicator());
@@ -20,7 +23,7 @@ class BalanceWidget extends StatelessWidget {
final wallets = walletsProvider.wallets;
if (wallets == null || wallets.isEmpty) {
return const Center(child: Text('No wallets available'));
return Center(child: Text(loc.noWalletsAvailable));
}
return
@@ -29,4 +32,4 @@ class BalanceWidget extends StatelessWidget {
onWalletChanged: walletsProvider.selectWallet,
);
}
}
}

View File

@@ -23,7 +23,7 @@ class UploadHistorySection extends StatelessWidget {
return const Center(child: CircularProgressIndicator());
}
if (provider.error != null) {
return Text("Error: ${provider.error}");
return Text(l10.notificationError(provider.error ?? l10.noErrorInformation));
}
final items = provider.data ?? [];

View File

@@ -9,6 +9,8 @@ import 'package:pweb/pages/dashboard/payouts/single/adress_book/long_list/long_l
import 'package:pweb/pages/dashboard/payouts/single/adress_book/short_list.dart';
import 'package:pweb/providers/recipient.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class AdressBookPayout extends StatefulWidget {
final ValueChanged<Recipient> onSelected;
@@ -54,6 +56,7 @@ class _AdressBookPayoutState extends State<AdressBookPayout> {
@override
Widget build(BuildContext context) {
final loc = AppLocalizations.of(context)!;
final provider = context.watch<RecipientProvider>();
if (provider.isLoading) {
@@ -61,7 +64,7 @@ class _AdressBookPayoutState extends State<AdressBookPayout> {
}
if (provider.error != null) {
return Center(child: Text('Error: ${provider.error}'));
return Center(child: Text(loc.notificationError(provider.error ?? loc.noErrorInformation)));
}
return SizedBox(
@@ -100,4 +103,4 @@ class _AdressBookPayoutState extends State<AdressBookPayout> {
),
);
}
}
}