Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 3897 - no language selector for gallery, only for swipeable page #3924

Merged
merged 3 commits into from
Apr 30, 2023

Conversation

monsieurtanuki
Copy link
Contributor

@monsieurtanuki monsieurtanuki commented Apr 30, 2023

What

  • This PR brings consistency about multilingual images, in read AND write.
  • The carousel and the gallery images now match the app language.
  • In the swipeable page, you have a language selector and you now see actual multilingual images:
    • an image uploaded for that language
    • or an empty image with a "no image for that language yet" label
    • or an empty image with a "no image" label (in any language)

Screenshot

App in French

gallery swipeable with image
Screenshot_2023-04-30-11-03-00 Screenshot_2023-04-30-11-03-06
swipeable with no image / language swipeable with no image at all
Screenshot_2023-04-30-11-03-29 Screenshot_2023-04-30-11-03-13

Fixes bug(s)

Files

Main changes:

  • app_en.arb: added 2 translations ("no image" / "no image for that language")
  • app_fr.arb: added 2 translations ("no image" / "no image for that language")
  • nutrition_page_loaded.dart: removed an implicit language parameter
  • product_cards_helper.dart: refactoring
  • product_image_gallery_view.dart: removed the language selector
  • product_image_swipeable_view.dart: removed the language parameter; now we always start with the app language
  • product_image_viewer.dart: now always displays the (non) image for the specified language, with additional labels; added explicit language parameters
  • transient_file.dart: new method getImageLanguages

Added explicit language parameters for:

  • add_new_product_page.dart
  • background_task_crop.dart
  • background_task_image.dart
  • background_task_unselect.dart
  • edit_ingredients_page.dart
  • edit_new_packagings.dart
  • image_crop_page.dart
  • image_upload_card.dart
  • new_crop_page.dart
  • product_image_local_button.dart
  • product_image_server_button.dart
  • uploaded_image_gallery.dart

Main changes:
* `app_en.arb`: added 2 translations ("no image" / "no image for that language")
* `app_fr.arb`: added 2 translations ("no image" / "no image for that language")
* `nutrition_page_loaded.dart`: removed an implicit `language` parameter
* `product_cards_helper.dart`: refactoring
* `product_image_gallery_view.dart`: removed the language selector
* `product_image_swipeable_view.dart`: removed the language parameter; now we always start with the app language
* `product_image_viewer.dart`: now always displays the (non) image for the specified language, with additional labels; added explicit `language` parameters
* `transient_file.dart`: new method `getImageLanguages`

Added explicit `language` parameters for:
* `add_new_product_page.dart`: added an explicit `language` parameter
* `background_task_crop.dart`: added an explicit `language` parameter
* `background_task_image.dart`: added an explicit `language` parameter
* `background_task_unselect.dart`: added an explicit `language` parameter
* `edit_ingredients_page.dart`: added an explicit `language` parameter
* `edit_new_packagings.dart`: added an explicit `language` parameter
* `image_crop_page.dart`: added an explicit `language` parameter
* `image_upload_card.dart`: added an explicit `language` parameter
* `new_crop_page.dart`: added an explicit `language` parameter
* `product_image_local_button.dart`: added an explicit `language` parameter
* `product_image_server_button.dart`: added an explicit `language` parameter
* `uploaded_image_gallery.dart`: added an explicit `language` parameter
@monsieurtanuki monsieurtanuki requested a review from a team as a code owner April 30, 2023 09:15
@github-actions github-actions bot added database 🌐 l10n ✏️ Editing - Nutrition input ✏️ Editing - Packaging input Related to the structured input of food packaging. 🖼️ Photos - Cropping Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. 🥫 Product page labels Apr 30, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2023

Codecov Report

Merging #3924 (42552b3) into develop (558034f) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #3924      +/-   ##
===========================================
- Coverage    10.63%   10.62%   -0.01%     
===========================================
  Files          268      268              
  Lines        13494    13506      +12     
===========================================
  Hits          1435     1435              
- Misses       12059    12071      +12     
Impacted Files Coverage Δ
...mooth_app/lib/background/background_task_crop.dart 0.00% <0.00%> (ø)
...ooth_app/lib/background/background_task_image.dart 0.00% <0.00%> (ø)
...h_app/lib/background/background_task_unselect.dart 0.00% <0.00%> (ø)
...th_app/lib/cards/data_cards/image_upload_card.dart 0.00% <0.00%> (ø)
...ckages/smooth_app/lib/database/transient_file.dart 0.00% <0.00%> (ø)
.../smooth_app/lib/helpers/image_field_extension.dart 0.00% <0.00%> (ø)
...s/smooth_app/lib/helpers/product_cards_helper.dart 0.00% <0.00%> (ø)
...th_app/lib/pages/image/uploaded_image_gallery.dart 0.00% <0.00%> (ø)
packages/smooth_app/lib/pages/image_crop_page.dart 0.00% <ø> (ø)
...th_app/lib/pages/product/add_new_product_page.dart 0.00% <0.00%> (ø)
... and 9 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@monsieurtanuki monsieurtanuki merged commit a8366fd into openfoodfacts:develop Apr 30, 2023
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!
I think this time the interface is consistent.

There's still a minor bug when you unselect an image that you just added (it's not taken into account immediately), that I'm about to fix. The bug was already there before the multilingual feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database ✏️ Editing - Nutrition input ✏️ Editing - Packaging input Related to the structured input of food packaging. 🌐 l10n 🖼️ Photos - Cropping Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. 🥫 Product page
Projects
None yet
3 participants