feat: Flutter client localisation (12 languages)

Add flutter_localizations + intl, 12 ARB files (en/ru/es/de/fr/it/pt/zh/ja/ko/ar/hi),
replace all hardcoded Russian UI strings with AppLocalizations, detect system locale
on first launch, localise bottom nav bar labels, document rule in CLAUDE.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
dbastrikin
2026-03-19 22:22:52 +02:00
parent 9357c194eb
commit 54b10d51e2
40 changed files with 5919 additions and 267 deletions

View File

@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import '../../l10n/app_localizations.dart';
import '../auth/auth_provider.dart';
import '../../features/auth/login_screen.dart';
import '../../features/auth/register_screen.dart';
@@ -208,15 +210,17 @@ class MainShell extends ConsumerWidget {
orElse: () => 0,
);
final l10n = AppLocalizations.of(context)!;
return Scaffold(
body: child,
bottomNavigationBar: BottomNavigationBar(
currentIndex: currentIndex,
onTap: (index) => context.go(_tabs[index]),
items: [
const BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Главная',
BottomNavigationBarItem(
icon: const Icon(Icons.home),
label: l10n.navHome,
),
BottomNavigationBarItem(
icon: Badge(
@@ -224,19 +228,19 @@ class MainShell extends ConsumerWidget {
label: Text('$expiringCount'),
child: const Icon(Icons.kitchen),
),
label: 'Продукты',
label: l10n.navProducts,
),
const BottomNavigationBarItem(
icon: Icon(Icons.calendar_month),
label: 'Меню',
BottomNavigationBarItem(
icon: const Icon(Icons.calendar_month),
label: l10n.menu,
),
const BottomNavigationBarItem(
icon: Icon(Icons.menu_book),
label: 'Рецепты',
BottomNavigationBarItem(
icon: const Icon(Icons.menu_book),
label: l10n.navRecipes,
),
const BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Профиль',
BottomNavigationBarItem(
icon: const Icon(Icons.person),
label: l10n.profileTitle,
),
],
),