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

@@ -40,7 +40,7 @@ enum PayoutDestination {
case PayoutDestination.addrecipient:
return loc.addRecipient;
case PayoutDestination.editwallet:
return 'Edit Wallet';
return loc.editWallet;
}
}
}

View File

@@ -15,6 +15,8 @@ import 'package:pweb/pages/dashboard/dashboard.dart';
import 'package:pweb/widgets/sidebar/destinations.dart';
import 'package:pweb/widgets/sidebar/sidebar.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class PageSelector extends StatelessWidget {
const PageSelector({super.key});
@@ -22,6 +24,7 @@ class PageSelector extends StatelessWidget {
@override
Widget build(BuildContext context) {
final provider = context.watch<PageSelectorProvider>();
final loc = AppLocalizations.of(context)!;
Widget content;
switch (provider.selected) {
@@ -76,7 +79,7 @@ class PageSelector extends StatelessWidget {
? WalletEditPage(
onBack: provider.goBackFromWalletEdit,
)
: const Center(child: Text('No wallet selected')); //TODO Localize
: Center(child: Text(loc.noWalletSelected));
break;
default:

View File

@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:pweb/widgets/sidebar/destinations.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class UserProfileCard extends StatelessWidget {
final ThemeData theme;
@@ -21,6 +23,7 @@ class UserProfileCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final loc = AppLocalizations.of(context)!;
bool isSelected = selected == PayoutDestination.settings;
final backgroundColor = isSelected
? theme.colorScheme.primaryContainer
@@ -52,7 +55,7 @@ class UserProfileCard extends StatelessWidget {
const SizedBox(width: 8),
Flexible(
child: Text(
userName ?? 'User Name',
userName ?? loc.userNamePlaceholder,
style: theme.textTheme.bodyLarge?.copyWith(
fontSize: 20,
fontWeight: FontWeight.w500,
@@ -67,4 +70,4 @@ class UserProfileCard extends StatelessWidget {
),
);
}
}
}