Add Swedish localization for various app actions and inventory management strings
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../../../core/l10n/l10n.dart';
|
||||
|
||||
/// Visar en dialogruta med ett felmeddelande och en kopieringsknapp.
|
||||
void showErrorDialog(BuildContext context, String errorMessage) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Fel'),
|
||||
title: Text(context.l10n.errorDialogTitle),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -17,17 +19,17 @@ void showErrorDialog(BuildContext context, String errorMessage) {
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('Stäng'),
|
||||
child: Text(context.l10n.errorDialogClose),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: const Text('Kopiera'),
|
||||
child: Text(context.l10n.errorDialogCopy),
|
||||
onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: errorMessage));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Felmeddelande kopierat!')),
|
||||
SnackBar(content: Text(context.l10n.errorDialogCopied)),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user