From 9dca68a298a651d248107be4be5142e40dfa91cd Mon Sep 17 00:00:00 2001 From: Pierre Slamich Date: Sun, 17 Apr 2022 19:12:38 +0200 Subject: [PATCH 1/2] CI: run Crowdin every night (#1597) CI: run Crowdin every night This will save me a few minutes each day --- .github/workflows/crowdin.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index d866b221e89..c8a00f86feb 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -3,6 +3,8 @@ name: Crowdin Action on: push: branches: [ crowdin-trigger ] + schedule: + - cron: "0 0 * * *" jobs: synchronize-with-crowdin: From ffec189e8cd472b0673012997e094417f565dece Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Sun, 17 Apr 2022 19:13:23 +0200 Subject: [PATCH 2/2] feat: Uploading dialog with a message based on the photo type (#1592) * Uploading an image won't show a generic message, but a different one based on the type * A full sentence per type --- .../lib/helpers/picture_capture_helper.dart | 25 ++++++++++++++++- packages/smooth_app/lib/l10n/app_en.arb | 28 ++++++++++++++++--- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/packages/smooth_app/lib/helpers/picture_capture_helper.dart b/packages/smooth_app/lib/helpers/picture_capture_helper.dart index 7ea91e7debc..4f558458bf8 100644 --- a/packages/smooth_app/lib/helpers/picture_capture_helper.dart +++ b/packages/smooth_app/lib/helpers/picture_capture_helper.dart @@ -26,7 +26,10 @@ Future uploadCapturedPicture( ProductQuery.getUser(), image, ), - title: appLocalizations.uploading_image, + title: _imageFieldLabel( + appLocalizations, + imageField, + ), ); if (result == null || result.error != null || result.status != 'status ok') { await LoadingDialog.error( @@ -39,6 +42,26 @@ Future uploadCapturedPicture( return true; } +String _imageFieldLabel( + AppLocalizations appLocalizations, + ImageField field, +) { + switch (field) { + case ImageField.FRONT: + return appLocalizations.uploading_image_type_front; + case ImageField.INGREDIENTS: + return appLocalizations.uploading_image_type_ingredients; + case ImageField.NUTRITION: + return appLocalizations.uploading_image_type_nutrition; + case ImageField.PACKAGING: + return appLocalizations.uploading_image_type_packaging; + case ImageField.OTHER: + return appLocalizations.uploading_image_type_other; + default: + return appLocalizations.uploading_image_type_generic; + } +} + Future _updateContinuousScanModel( BuildContext context, String barcode) async { final ContinuousScanModel? model = diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index 55c1439a63e..b1b94a6c2c1 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -438,10 +438,30 @@ "@selecting_photo": { "description": "Progress indicator when the users takes a photo" }, - "uploading_image": "Uploading photo to the server", - "@uploading_image": { - "description": "Message when a new picture is uploading to the server" - }, + "uploading_image_type_front": "Uploading front image to Open Food Facts", + "@uploading_image_type_front": { + "description": "Message when a new front picture is being uploaded to the server" + }, + "uploading_image_type_ingredients": "Uploading ingredients image to Open Food Facts", + "@uploading_image_type_ingredients": { + "description": "Message when a new ingredients picture is being uploaded to the server" + }, + "uploading_image_type_nutrition": "Uploading nutrition image to Open Food Facts", + "@uploading_image_type_nutrition": { + "description": "Message when a new nutrition picture is being uploaded to the server" + }, + "uploading_image_type_packaging": "Uploading packaging image to Open Food Facts", + "@uploading_image_type_packaging": { + "description": "Message when a new packaging picture is being uploaded to the server" + }, + "uploading_image_type_other": "Uploading other image to Open Food Facts", + "@uploading_image_type_other": { + "description": "Message when a new other picture is being uploaded to the server" + }, + "uploading_image_type_generic": "Uploading image to Open Food Facts", + "@uploading_image_type_generic": { + "description": "Message when a new picture is being uploaded to the server" + }, "score_add_missing_ingredients": "Add missing ingredients", "score_add_missing_nutrition_facts": "Add missing nutrition facts", "score_add_missing_product_category": "Add missing product category",