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: Improve a11n by forcing a label on Nutri-Score / Eco-score / NOVA buttons #4356

Merged
merged 8 commits into from
Jul 29, 2023

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Jul 22, 2023

Hi everyone,

On the product page, screen readers will only tell "Good Nutritional Quality", but without saying it's a Nutri-Score B.
This PR implements the feature both for the Nutri-Score and also the Eco-score

Screenshot_1690010900

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2023

Codecov Report

Merging #4356 (2149b5f) into develop (23956fa) will decrease coverage by 0.06%.
The diff coverage is 5.70%.

@@             Coverage Diff             @@
##           develop    #4356      +/-   ##
===========================================
- Coverage    10.34%   10.28%   -0.06%     
===========================================
  Files          293      293              
  Lines        14636    14746     +110     
===========================================
+ Hits          1514     1517       +3     
- Misses       13122    13229     +107     
Impacted Files Coverage Δ
...smooth_app/lib/cards/category_cards/svg_cache.dart 0.00% <0.00%> (ø)
...es/smooth_app/lib/cards/data_cards/score_card.dart 0.00% <0.00%> (ø)
...kages/smooth_app/lib/data_models/product_list.dart 0.00% <0.00%> (ø)
...generic_lib/bottom_sheets/smooth_bottom_sheet.dart 0.00% <0.00%> (ø)
...b/bottom_sheets/smooth_draggable_bottom_sheet.dart 0.00% <0.00%> (ø)
...l/knowledge_panels/knowledge_panel_title_card.dart 0.00% <0.00%> (ø)
...es/smooth_app/lib/pages/all_product_list_page.dart 0.00% <0.00%> (-2.78%) ⬇️
packages/smooth_app/lib/pages/history_page.dart 10.00% <ø> (ø)
...ib/pages/preferences/user_preferences_widgets.dart 8.49% <0.00%> (+0.05%) ⬆️
...p/lib/pages/product/common/product_list_modal.dart 0.00% <0.00%> (ø)
... and 4 more

... and 1 file with indirect coverage changes

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

@github-actions
Copy link
Contributor

@g123k g123k changed the title feat: Improve a11n by forcing a label on Nutri-Score and Eco-score buttons feat: Improve a11n by forcing a label on Nutri-Score / Eco-score / NOVA buttons Jul 22, 2023
@@ -2320,5 +2320,24 @@
"country_selector_title": "Select your country:",
"@country_selector_title": {
"description": "Label written as the title of the dialog to select the user country"
}
},
"nutriscore_a": "Nutri-Score A",
Copy link
Member

Choose a reason for hiding this comment

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

We're going to get "Nutri-Skor A" and the likes, which is a pain to maintain translation wise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For Nutri-Score, yes maybe…
But for Eco-score, in French we should say Éco-score :/
What would be the best approach?

Copy link
Member

Choose a reason for hiding this comment

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

The branding for Eco-Score is not completely stabilized. Eco-Score won't hurt, I guess.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok and what about NOVA, where "group" can also be translated?

Copy link
Member

Choose a reason for hiding this comment

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

For nova, you mean the Ultra-processed foods attributes ? Do you want to concatenate NOVA to it ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The idea here is to provide a description that will be read by screen readers.
That's why I've provided a description for Nutriscore/Nova/Ecoscore, because now screen readers won't say anything

@g123k g123k force-pushed the a11n_nutriscore_ecoscore branch from 2a056aa to 2149b5f Compare July 24, 2023 08:46
@teolemon teolemon merged commit fe7189c into openfoodfacts:develop Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants