Skip to content

Commit

Permalink
fix: #2773 - appropriate "clear?" and "delete?" messages for user lis…
Browse files Browse the repository at this point in the history
…ts (#2778)

Impacted files:
* `app_en.arb`: labels for user lists (clear? + delete?)
* `app_fr.arb`: labels for user lists (clear? + delete?)
 * `product_list_page.dart`: now using the new "clear?" label for user lists
 * `product_list_user_dialog_helper.dart`: now localizing with the new "delete?" label for user lists
  • Loading branch information
monsieurtanuki committed Aug 16, 2022
1 parent d922511 commit 3deb4cb
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 7 deletions.
22 changes: 20 additions & 2 deletions packages/smooth_app/lib/l10n/app_en.arb
Expand Up @@ -1476,9 +1476,27 @@
"@basic_details_add_error": {
"description": "Error message when error occurs while submitting basic details"
},
"confirm_clear": "You're about to delete your entire history, are you sure you want to continue?",
"confirm_clear": "You're about to clear your entire history: are you sure you want to continue?",
"@confirm_clear": {
"description": "Asking about whether to clear the list or not"
"description": "Asking about whether to clear the history list or not"
},
"confirm_clear_user_list": "You're about to clear this list ({name}): are you sure you want to continue?",
"@confirm_clear_user_list": {
"description": "Asking about whether to clear the list or not",
"placeholders": {
"name": {
"type": "String"
}
}
},
"confirm_delete_user_list": "You're about to delete this list ({name}): are you sure you want to continue?",
"@confirm_delete_user_list": {
"description": "Asking about whether to delete the list or not",
"placeholders": {
"name": {
"type": "String"
}
}
},
"importance_label": "{name} importance: {id}",
"@importance_label": {
Expand Down
22 changes: 20 additions & 2 deletions packages/smooth_app/lib/l10n/app_fr.arb
Expand Up @@ -1474,9 +1474,27 @@
"@basic_details_add_error": {
"description": "Error message when error occurs while submitting basic details"
},
"confirm_clear": "Vous êtes sur le point de supprimer tout votre historique, êtes-vous sûr de vouloir continuer ?",
"confirm_clear": "Vous êtes sur le point d'effacer votre historique : êtes-vous sûr de vouloir continuer ?",
"@confirm_clear": {
"description": "Asking about whether to clear the list or not"
"description": "Asking about whether to clear the history list or not"
},
"confirm_clear_user_list": "Vous êtes sur le point de vider cette liste ({name}) : êtes-vous sûr de vouloir continuer ?",
"@confirm_clear_user_list": {
"description": "Asking about whether to clear the list or not",
"placeholders": {
"name": {
"type": "String"
}
}
},
"confirm_delete_user_list": "Vous êtes sur le point de supprimer cette liste ({name}) : êtes-vous sûr de vouloir continuer ?",
"@confirm_delete_user_list": {
"description": "Asking about whether to delete the list or not",
"placeholders": {
"name": {
"type": "String"
}
}
},
"importance_label": "{name} importance : {id}",
"@importance_label": {
Expand Down
Expand Up @@ -98,7 +98,12 @@ class _ProductListPageState extends State<ProductListPage>
context: context,
builder: (BuildContext context) {
return SmoothAlertDialog(
body: Text(appLocalizations.confirm_clear),
body: Text(
productList.listType == ProductListType.USER
? appLocalizations.confirm_clear_user_list(
productList.parameters)
: appLocalizations.confirm_clear,
),
positiveAction: SmoothActionButton(
onPressed: () async {
await daoProductList.clear(productList);
Expand Down
Expand Up @@ -224,8 +224,9 @@ class ProductListUserDialogHelper {
final bool? deleted = await showDialog<bool>(
context: context,
builder: (final BuildContext context) => SmoothAlertDialog(
title: 'Delete list?',
body: Text(productList.parameters),
body: Text(
appLocalizations.confirm_delete_user_list(productList.parameters),
),
negativeAction: SmoothActionButton(
onPressed: () => Navigator.pop(context),
text: appLocalizations.cancel,
Expand Down

0 comments on commit 3deb4cb

Please sign in to comment.