feat: reformat some pages

This commit is contained in:
2026-10-26 23:15:05 +01:00
parent 65e5e286b0
commit 08f4847800
17 changed files with 812 additions and 198 deletions
+23
View File
@@ -301,6 +301,29 @@
"duplicateTabNameDescription": "A tab named {name} is already open. Use this name anyway?",
"@duplicateTabNameDescription": {"placeholders": {"name": {"type": "String"}}},
"deleteTabWithItemsDescription": "This tab still has drinks on it. Deleting it returns them to stock and leaves nothing in history. Enter the admin PIN to continue.",
"pinSaved": "PIN saved",
"deviceLinkedToVenue": "Linked to {venue}",
"@deviceLinkedToVenue": {"placeholders": {"venue": {"type": "String"}}},
"justNow": "just now",
"minutesAgo": "{count, plural, =1{1 minute ago} other{{count} minutes ago}}",
"@minutesAgo": {"placeholders": {"count": {"type": "int"}}},
"hoursAgo": "{count, plural, =1{1 hour ago} other{{count} hours ago}}",
"@hoursAgo": {"placeholders": {"count": {"type": "int"}}},
"remoteCommandCloseTab": "Close tab from dashboard",
"remoteCommandUnknown": "Unknown command ({type})",
"@remoteCommandUnknown": {"placeholders": {"type": {"type": "String"}}},
"commandCompleted": "Done",
"commandConflict": "Conflict",
"commandFailed": "Failed",
"commandExpired": "Expired",
"searchProducts": "Search products…",
"allCategories": "All",
"noProductsMatch": "No products match your search.",
"lowStock": "Low stock",
"productHidden": "Hidden",
"addFirstProduct": "Add your first product to start selling.",
"productStockCount": "Stock: {count}",
"@productStockCount": {"placeholders": {"count": {"type": "int"}}},
"connectingToServer": "Connecting to server…",
"failedToConnect": "Failed to connect",
"unknownError": "Unknown error",
+102
View File
@@ -1772,6 +1772,108 @@ abstract class AppLocalizations {
/// **'This tab still has drinks on it. Deleting it returns them to stock and leaves nothing in history. Enter the admin PIN to continue.'**
String get deleteTabWithItemsDescription;
/// No description provided for @pinSaved.
///
/// In en, this message translates to:
/// **'PIN saved'**
String get pinSaved;
/// No description provided for @deviceLinkedToVenue.
///
/// In en, this message translates to:
/// **'Linked to {venue}'**
String deviceLinkedToVenue(String venue);
/// No description provided for @justNow.
///
/// In en, this message translates to:
/// **'just now'**
String get justNow;
/// No description provided for @minutesAgo.
///
/// In en, this message translates to:
/// **'{count, plural, =1{1 minute ago} other{{count} minutes ago}}'**
String minutesAgo(int count);
/// No description provided for @hoursAgo.
///
/// In en, this message translates to:
/// **'{count, plural, =1{1 hour ago} other{{count} hours ago}}'**
String hoursAgo(int count);
/// No description provided for @remoteCommandCloseTab.
///
/// In en, this message translates to:
/// **'Close tab from dashboard'**
String get remoteCommandCloseTab;
/// No description provided for @remoteCommandUnknown.
///
/// In en, this message translates to:
/// **'Unknown command ({type})'**
String remoteCommandUnknown(String type);
/// No description provided for @commandCompleted.
///
/// In en, this message translates to:
/// **'Done'**
String get commandCompleted;
/// No description provided for @commandConflict.
///
/// In en, this message translates to:
/// **'Conflict'**
String get commandConflict;
/// No description provided for @commandFailed.
///
/// In en, this message translates to:
/// **'Failed'**
String get commandFailed;
/// No description provided for @commandExpired.
///
/// In en, this message translates to:
/// **'Expired'**
String get commandExpired;
/// No description provided for @searchProducts.
///
/// In en, this message translates to:
/// **'Search products…'**
String get searchProducts;
/// No description provided for @allCategories.
///
/// In en, this message translates to:
/// **'All'**
String get allCategories;
/// No description provided for @noProductsMatch.
///
/// In en, this message translates to:
/// **'No products match your search.'**
String get noProductsMatch;
/// No description provided for @lowStock.
///
/// In en, this message translates to:
/// **'Low stock'**
String get lowStock;
/// No description provided for @productHidden.
///
/// In en, this message translates to:
/// **'Hidden'**
String get productHidden;
/// No description provided for @productStockCount.
///
/// In en, this message translates to:
/// **'Stock: {count}'**
String productStockCount(int count);
/// No description provided for @connectingToServer.
///
/// In en, this message translates to:
+73
View File
@@ -923,6 +923,79 @@ class AppLocalizationsEn extends AppLocalizations {
String get deleteTabWithItemsDescription =>
'This tab still has drinks on it. Deleting it returns them to stock and leaves nothing in history. Enter the admin PIN to continue.';
@override
String get pinSaved => 'PIN saved';
@override
String deviceLinkedToVenue(String venue) {
return 'Linked to $venue';
}
@override
String get justNow => 'just now';
@override
String minutesAgo(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count minutes ago',
one: '1 minute ago',
);
return '$_temp0';
}
@override
String hoursAgo(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count hours ago',
one: '1 hour ago',
);
return '$_temp0';
}
@override
String get remoteCommandCloseTab => 'Close tab from dashboard';
@override
String remoteCommandUnknown(String type) {
return 'Unknown command ($type)';
}
@override
String get commandCompleted => 'Done';
@override
String get commandConflict => 'Conflict';
@override
String get commandFailed => 'Failed';
@override
String get commandExpired => 'Expired';
@override
String get searchProducts => 'Search products…';
@override
String get allCategories => 'All';
@override
String get noProductsMatch => 'No products match your search.';
@override
String get lowStock => 'Low stock';
@override
String get productHidden => 'Hidden';
@override
String productStockCount(int count) {
return 'Stock: $count';
}
@override
String get connectingToServer => 'Connecting to server…';
+29
View File
@@ -1,4 +1,7 @@
import 'package:intl/intl.dart';
import '../models/app_error.dart';
import '../models/remote_command.dart';
import '../models/update_failure.dart';
import 'app_localizations.dart';
@@ -17,6 +20,32 @@ extension AppLocalizationsHelpers on AppLocalizations {
};
}
/// "just now", "5 minutes ago"…, and the full date once a day has passed.
String relativeTime(DateTime time, String locale, {DateTime? now}) {
final elapsed = (now ?? DateTime.now()).difference(time);
if (elapsed.inMinutes < 1) return justNow;
if (elapsed.inHours < 1) return minutesAgo(elapsed.inMinutes);
if (elapsed.inDays < 1) return hoursAgo(elapsed.inHours);
return DateFormat.yMMMd(locale).add_jm().format(time.toLocal());
}
String remoteCommandLabel(String rawType) {
return switch (CommandType.fromValue(rawType)) {
CommandType.closeTab => remoteCommandCloseTab,
null => remoteCommandUnknown(rawType),
};
}
String commandResultLabel(CommandResult result) {
return switch (result) {
CommandResult.completed => commandCompleted,
CommandResult.conflict => commandConflict,
CommandResult.failed => commandFailed,
CommandResult.expired => commandExpired,
};
}
String errorText(AppError? error) {
return switch (error) {
null => genericError,
+75 -1
View File
@@ -24,7 +24,8 @@ class AppLocalizationsNl extends AppLocalizations {
String get noProductsYet => 'Nog geen producten.';
@override
String get addFirstProduct => 'Voeg je eerste product toe om te beginnen.';
String get addFirstProduct =>
'Voeg je eerste product toe om te beginnen verkopen.';
@override
String get manageProducts => 'Producten beheren';
@@ -935,6 +936,79 @@ class AppLocalizationsNl extends AppLocalizations {
String get deleteTabWithItemsDescription =>
'Op deze poef staan nog drankjes. Verwijderen zet ze terug in de voorraad en laat niets na in de geschiedenis. Geef de beheer-PIN in om door te gaan.';
@override
String get pinSaved => 'PIN opgeslagen';
@override
String deviceLinkedToVenue(String venue) {
return 'Gekoppeld aan $venue';
}
@override
String get justNow => 'zonet';
@override
String minutesAgo(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count minuten geleden',
one: '1 minuut geleden',
);
return '$_temp0';
}
@override
String hoursAgo(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count uur geleden',
one: '1 uur geleden',
);
return '$_temp0';
}
@override
String get remoteCommandCloseTab => 'Poef sluiten via dashboard';
@override
String remoteCommandUnknown(String type) {
return 'Onbekende opdracht ($type)';
}
@override
String get commandCompleted => 'Uitgevoerd';
@override
String get commandConflict => 'Conflict';
@override
String get commandFailed => 'Mislukt';
@override
String get commandExpired => 'Verlopen';
@override
String get searchProducts => 'Producten zoeken…';
@override
String get allCategories => 'Alle';
@override
String get noProductsMatch => 'Geen producten gevonden.';
@override
String get lowStock => 'Bijna op';
@override
String get productHidden => 'Verborgen';
@override
String productStockCount(int count) {
return 'Voorraad: $count';
}
@override
String get connectingToServer => 'Verbinden met server…';
+18
View File
@@ -300,6 +300,24 @@
"duplicateTabName": "Naam al in gebruik",
"duplicateTabNameDescription": "Er is al een poef open met de naam {name}. Toch deze naam gebruiken?",
"deleteTabWithItemsDescription": "Op deze poef staan nog drankjes. Verwijderen zet ze terug in de voorraad en laat niets na in de geschiedenis. Geef de beheer-PIN in om door te gaan.",
"pinSaved": "PIN opgeslagen",
"deviceLinkedToVenue": "Gekoppeld aan {venue}",
"justNow": "zonet",
"minutesAgo": "{count, plural, =1{1 minuut geleden} other{{count} minuten geleden}}",
"hoursAgo": "{count, plural, =1{1 uur geleden} other{{count} uur geleden}}",
"remoteCommandCloseTab": "Poef sluiten via dashboard",
"remoteCommandUnknown": "Onbekende opdracht ({type})",
"commandCompleted": "Uitgevoerd",
"commandConflict": "Conflict",
"commandFailed": "Mislukt",
"commandExpired": "Verlopen",
"searchProducts": "Producten zoeken…",
"allCategories": "Alle",
"noProductsMatch": "Geen producten gevonden.",
"lowStock": "Bijna op",
"productHidden": "Verborgen",
"addFirstProduct": "Voeg je eerste product toe om te beginnen verkopen.",
"productStockCount": "Voorraad: {count}",
"connectingToServer": "Verbinden met server…",
"failedToConnect": "Verbinden mislukt",
"unknownError": "Onbekende fout",