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: Multi-lingual input for product name + help banner #6286

Merged
merged 8 commits into from
Jan 27, 2025

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Jan 25, 2025

Hi everyone!

It's time to say goodbye to the old way of inputting translations for the product name.
Everything is now on a list.

Sort order:

  1. The default language
  2. The user language (if available)
  3. Other languages sorted alphabetically

Also, we list front pictures without a product name.

Video:

ScreenRecording_01-25-2025.22-45-24_1.MP4

Collapsed list limited to 3 languages

Untitled

New language

When a new language is added, it will always be at the bottom (collapsed or not)
Untitled

Direct access to the photo

Same UI as nutrition facts + we can upload a photo directly
IMG_2005

Help banner

Feel free to change the content
IMG_2009

Dark mode

This time, I've checked ;)
IMG_2004

@github-actions github-actions bot added 🥫 Product page GitHub 🌐 l10n ✏️ Editing Many products are incomplete and don't have Nutri-Score, Eco-Score…so editing is important for users ✏️ Editing - Nutrition input ✏️ Editing - Basic info input autocomplete labels Jan 25, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2025

Codecov Report

Attention: Patch coverage is 0.74906% with 265 lines in your changes missing coverage. Please review.

Project coverage is 5.96%. Comparing base (4d9c7fc) to head (e3ca2e4).
Report is 707 commits behind head on develop.

Files with missing lines Patch % Lines
...oth_app/lib/widgets/smooth_explanation_banner.dart 0.00% 137 Missing ⚠️
...duct/add_basic_details/add_basic_details_name.dart 1.83% 107 Missing ⚠️
.../lib/data_models/preferences/user_preferences.dart 0.00% 5 Missing ⚠️
...generic_lib/bottom_sheets/smooth_bottom_sheet.dart 0.00% 5 Missing ⚠️
...ges/smooth_app/lib/themes/smooth_theme_colors.dart 0.00% 4 Missing ⚠️
.../lib/generic_lib/html/smooth_html_marker_chip.dart 0.00% 1 Missing ⚠️
...b/generic_lib/html/smooth_html_marker_decimal.dart 0.00% 1 Missing ⚠️
...h_app/lib/pages/prices/product_price_add_page.dart 0.00% 1 Missing ⚠️
...b/pages/product/nutrition_page/nutrition_page.dart 0.00% 1 Missing ⚠️
...page/widgets/nutrition_availability_container.dart 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #6286      +/-   ##
==========================================
- Coverage     9.54%   5.96%   -3.59%     
==========================================
  Files          325     472     +147     
  Lines        16411   27940   +11529     
==========================================
+ Hits          1567    1666      +99     
- Misses       14844   26274   +11430     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@g123k g123k changed the title feat: Multi-lingual input for product name feat: Multi-lingual input for product name + help banner Jan 26, 2025
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.

Nesquick >> Nesquik

@teolemon
Copy link
Member

@g123k Can you add a warning you should not add your own translations if the language is not present on the packaging ?

@g123k
Copy link
Collaborator Author

g123k commented Jan 26, 2025

@g123k Can you add a warning you should not add your own translations if the language is not present on the packaging ?

Is it on the "Add a new language" button or the help?

@teolemon
Copy link
Member

  • As a first step in the help section
  • In the future (because I assume most people won't read the help section) On language addition, it could add a dismissible inline one-time warning (we need a settings key for that option though)

@g123k
Copy link
Collaborator Author

g123k commented Jan 26, 2025

I can do both now.
Here are two suggestions for the banner (or if you have a better idea)
Untitled

@teolemon
Copy link
Member

a translation, ... if the language is actually present on packaging

@g123k
Copy link
Collaborator Author

g123k commented Jan 26, 2025

a translation, ... if the language is actually present on packaging

Ooops wrong copy/paste.
When should I show this banner?
-> Not for the first translation?
-> When we add a language?

@teolemon
Copy link
Member

  • On language addition, one time ?
  • Some products are actually monolingual, so I'm not sure if the first translation thing would be pertinent

@teolemon
Copy link
Member

merge conflict

@g123k
Copy link
Collaborator Author

g123k commented Jan 26, 2025

Video with the banner:

ScreenRecording_01-26-2025.19-32-41_1.MP4

Banner:
IMG_8858C4EA9986-1

The bottom is not that good due to SafeArea on iOS
IMG_0596658DD6C3-1

@teolemon
Copy link
Member

Super sweet @g123k 🐿️🍷

@teolemon teolemon merged commit 74fe856 into openfoodfacts:develop Jan 27, 2025
6 checks passed
@g123k g123k deleted the product_name branch January 28, 2025 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants