feat: add alot
This commit is contained in:
+2
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"@@locale": "en",
|
||||
"appTitle": "KoolTab",
|
||||
"appTitle": "KoolTap",
|
||||
"barTabs": "Bar Tabs",
|
||||
"products": "Products",
|
||||
"addProduct": "Add product",
|
||||
@@ -114,6 +114,7 @@
|
||||
"pinsDidNotMatch": "PINs didn’t match. Try again.",
|
||||
"somethingWentWrong": "Something went wrong.",
|
||||
"incorrectPin": "Incorrect PIN.",
|
||||
"tooManyPinAttempts": "Too many attempts. Try again later.",
|
||||
"removed": "Removed",
|
||||
"enterPrice": "Enter a price.",
|
||||
"enterValidPrice": "Enter a valid price.",
|
||||
|
||||
@@ -101,7 +101,7 @@ abstract class AppLocalizations {
|
||||
/// No description provided for @appTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'KoolTab'**
|
||||
/// **'KoolTap'**
|
||||
String get appTitle;
|
||||
|
||||
/// No description provided for @barTabs.
|
||||
@@ -746,6 +746,12 @@ abstract class AppLocalizations {
|
||||
/// **'Incorrect PIN.'**
|
||||
String get incorrectPin;
|
||||
|
||||
/// No description provided for @tooManyPinAttempts.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Too many attempts. Try again later.'**
|
||||
String get tooManyPinAttempts;
|
||||
|
||||
/// No description provided for @removed.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
||||
@@ -9,7 +9,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
AppLocalizationsEn([String locale = 'en']) : super(locale);
|
||||
|
||||
@override
|
||||
String get appTitle => 'KoolTab';
|
||||
String get appTitle => 'KoolTap';
|
||||
|
||||
@override
|
||||
String get barTabs => 'Bar Tabs';
|
||||
@@ -361,6 +361,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
@override
|
||||
String get incorrectPin => 'Incorrect PIN.';
|
||||
|
||||
@override
|
||||
String get tooManyPinAttempts => 'Too many attempts. Try again later.';
|
||||
|
||||
@override
|
||||
String get removed => 'Removed';
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import '../models/app_error.dart';
|
||||
import 'app_localizations.dart';
|
||||
|
||||
extension AppLocalizationsHelpers on AppLocalizations {
|
||||
@@ -15,32 +16,37 @@ extension AppLocalizationsHelpers on AppLocalizations {
|
||||
};
|
||||
}
|
||||
|
||||
String localizedError(String? message) {
|
||||
String errorText(AppError? error) {
|
||||
return switch (error) {
|
||||
null => genericError,
|
||||
AppError.loadBar => couldNotLoadBar,
|
||||
AppError.createTab => couldNotCreateTabMessage,
|
||||
AppError.outOfStock => productOutOfStock,
|
||||
AppError.addProductToTab => couldNotAddProductToTab,
|
||||
AppError.updateQuantity => couldNotUpdateQuantity,
|
||||
AppError.closeTab => couldNotCloseTab,
|
||||
AppError.renameTab => couldNotRenameTab,
|
||||
AppError.deleteTab => couldNotDeleteTab,
|
||||
AppError.loadHistory => couldNotLoadHistory,
|
||||
AppError.loadMoreTabs => couldNotLoadMoreTabs,
|
||||
AppError.loadProducts => couldNotLoadProducts,
|
||||
AppError.addProduct => couldNotAddProduct,
|
||||
AppError.updateProduct => couldNotUpdateProduct,
|
||||
AppError.deleteProduct => couldNotDeleteProduct,
|
||||
AppError.checkPinStatus => couldNotCheckPinStatus,
|
||||
AppError.savePin => couldNotSavePin,
|
||||
AppError.incorrectPin => incorrectPin,
|
||||
AppError.verifyPin => couldNotVerifyPin,
|
||||
AppError.currentPinIncorrect => currentPinIncorrect,
|
||||
AppError.tooManyPinAttempts => tooManyPinAttempts,
|
||||
AppError.loadSettings => couldNotLoadSettings,
|
||||
AppError.saveSettings => couldNotSaveSettings,
|
||||
};
|
||||
}
|
||||
|
||||
/// Update messages still come from the OTA plugin as plain strings.
|
||||
String _updateMessage(String? message) {
|
||||
return switch (message) {
|
||||
'Could not load bar screen.' => couldNotLoadBar,
|
||||
'Could not create tab.' => couldNotCreateTabMessage,
|
||||
'Product is out of stock.' => productOutOfStock,
|
||||
'Could not add product to tab.' => couldNotAddProductToTab,
|
||||
'Could not update item quantity.' => couldNotUpdateQuantity,
|
||||
'Could not close tab.' => couldNotCloseTab,
|
||||
'Could not rename tab.' => couldNotRenameTab,
|
||||
'Could not delete tab.' => couldNotDeleteTab,
|
||||
'Could not reload tabs.' => couldNotReloadTabs,
|
||||
'Could not load tab history.' => couldNotLoadHistory,
|
||||
'Could not load more tabs.' => couldNotLoadMoreTabs,
|
||||
'Could not load products.' => couldNotLoadProducts,
|
||||
'Could not add product.' => couldNotAddProduct,
|
||||
'Could not update product.' => couldNotUpdateProduct,
|
||||
'Could not check PIN status.' => couldNotCheckPinStatus,
|
||||
'Could not save PIN.' => couldNotSavePin,
|
||||
'Incorrect PIN.' => incorrectPin,
|
||||
'Could not verify PIN.' => couldNotVerifyPin,
|
||||
'Current PIN is incorrect.' => currentPinIncorrect,
|
||||
'Could not load settings.' => couldNotLoadSettings,
|
||||
'Could not save settings.' => couldNotSaveSettings,
|
||||
'Could not load product.' => couldNotLoadProduct,
|
||||
'Could not save product.' => couldNotSaveProduct,
|
||||
'Could not delete product.' => couldNotDeleteProduct,
|
||||
'Update failed' => updateFailed,
|
||||
'Download failed' => downloadFailed,
|
||||
'Installation failed' => installationFailed,
|
||||
@@ -76,7 +82,7 @@ extension AppLocalizationsHelpers on AppLocalizations {
|
||||
}
|
||||
if (message == 'Update already in progress') return updateAlreadyInProgress;
|
||||
|
||||
return localizedError(message);
|
||||
return _updateMessage(message);
|
||||
}
|
||||
|
||||
String devAction(String? message) {
|
||||
|
||||
@@ -9,7 +9,7 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
AppLocalizationsNl([String locale = 'nl']) : super(locale);
|
||||
|
||||
@override
|
||||
String get appTitle => 'KoolTab';
|
||||
String get appTitle => 'KoolTap';
|
||||
|
||||
@override
|
||||
String get barTabs => 'Poefs';
|
||||
@@ -362,6 +362,10 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
@override
|
||||
String get incorrectPin => 'Onjuiste PIN.';
|
||||
|
||||
@override
|
||||
String get tooManyPinAttempts =>
|
||||
'Te veel pogingen. Probeer het later opnieuw.';
|
||||
|
||||
@override
|
||||
String get removed => 'Verwijderd';
|
||||
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"@@locale": "nl",
|
||||
"appTitle": "KoolTab",
|
||||
"appTitle": "KoolTap",
|
||||
"barTabs": "Poefs",
|
||||
"products": "Producten",
|
||||
"addProduct": "Product toevoegen",
|
||||
@@ -114,6 +114,7 @@
|
||||
"pinsDidNotMatch": "PINs kwamen niet overeen. Probeer het opnieuw.",
|
||||
"somethingWentWrong": "Er is iets misgegaan.",
|
||||
"incorrectPin": "Onjuiste PIN.",
|
||||
"tooManyPinAttempts": "Te veel pogingen. Probeer het later opnieuw.",
|
||||
"removed": "Verwijderd",
|
||||
"enterPrice": "Voer een prijs in.",
|
||||
"enterValidPrice": "Voer een geldige prijs in.",
|
||||
|
||||
Reference in New Issue
Block a user