Skip to content

Commit

Permalink
Merge branch 'develop' into camera_permission
Browse files Browse the repository at this point in the history
  • Loading branch information
teolemon committed Apr 17, 2022
2 parents 8b0adc5 + ffec189 commit f7bf249
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Crowdin Action
on:
push:
branches: [ crowdin-trigger ]
schedule:
- cron: "0 0 * * *"

jobs:
synchronize-with-crowdin:
Expand Down
25 changes: 24 additions & 1 deletion packages/smooth_app/lib/helpers/picture_capture_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ Future<bool> 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(
Expand All @@ -39,6 +42,26 @@ Future<bool> 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<void> _updateContinuousScanModel(
BuildContext context, String barcode) async {
final ContinuousScanModel? model =
Expand Down

0 comments on commit f7bf249

Please sign in to comment.