Add Swedish localization for various app actions and inventory management strings
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../../../core/api/api_error_mapper.dart';
|
||||
import '../../../core/l10n/l10n.dart';
|
||||
import '../../../core/ui/async_state_views.dart';
|
||||
import '../data/recipe_providers.dart';
|
||||
import '../data/recipes_grid_provider.dart';
|
||||
@@ -22,16 +23,16 @@ class RecipesScreen extends ConsumerWidget {
|
||||
return Stack(
|
||||
children: [
|
||||
recipesAsync.when(
|
||||
loading: () => const LoadingStateView(label: 'Laddar recept...'),
|
||||
loading: () => LoadingStateView(label: context.l10n.recipesLoading),
|
||||
error: (error, _) => ErrorStateView(
|
||||
message: mapErrorToUserMessage(error, context),
|
||||
onRetry: () => ref.invalidate(recipesProvider),
|
||||
),
|
||||
data: (recipes) {
|
||||
if (recipes.isEmpty) {
|
||||
return const EmptyStateView(
|
||||
title: 'Inga recept hittades',
|
||||
description: 'Lägg till ett recept för att komma igång.',
|
||||
return EmptyStateView(
|
||||
title: context.l10n.recipesEmpty,
|
||||
description: context.l10n.recipesEmptyDescription,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ class RecipesScreen extends ConsumerWidget {
|
||||
right: 16,
|
||||
bottom: 16,
|
||||
child: FloatingActionButton(
|
||||
tooltip: 'Nytt recept',
|
||||
tooltip: context.l10n.recipesNewTooltip,
|
||||
onPressed: () => context.push('/recipes/create'),
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user