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

fix: 816 - use localized versions of productName and ingredientsText #817

Merged
merged 1 commit into from
Oct 28, 2023

Conversation

monsieurtanuki
Copy link
Contributor

What

  • From about a week ago, productName and ingredientsText could not be 100% trusted anymore in a multilingual context.
  • More specifically, you could not trust the product name to be in German if you asked for a list of languages with German first (on a product that has German and other translations).
  • The solution is to use the localized version of productName. And as a fallback, productName.
  • Same thing for ingredientsText.
  • The unit tests failed and that's the reason of the current PR.

Fixes bug(s)

Impacted files

  • api_get_save_product_test.dart: removed tests on productName and ingredientsText; refactored
  • product.dart: added comments about using rather the localized fields for productName and ingredientsText

Impacted files:
* `api_get_save_product_test.dart`: removed tests on productName and ingredientsText; refactored
* `product.dart`: added comments about using rather the localized fields for productName and ingredientsText
@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2023

Codecov Report

Merging #817 (2237d0d) into master (df85a38) will increase coverage by 0.63%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #817      +/-   ##
==========================================
+ Coverage   75.59%   76.22%   +0.63%     
==========================================
  Files         205      205              
  Lines        7580     7537      -43     
==========================================
+ Hits         5730     5745      +15     
+ Misses       1850     1792      -58     
Files Coverage Δ
lib/src/model/product.dart 80.98% <ø> (ø)
test/api_get_save_product_test.dart 97.69% <100.00%> (+18.81%) ⬆️

... and 2 files with indirect coverage changes

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

Copy link
Contributor

@g123k g123k left a comment

Choose a reason for hiding this comment

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

Seems indeed better to add explanations in the SDK.
Thanks @monsieurtanuki!

@monsieurtanuki monsieurtanuki merged commit 60f7d1e into openfoodfacts:master Oct 28, 2023
5 checks passed
@monsieurtanuki
Copy link
Contributor Author

Seems indeed better to add explanations in the SDK. Thanks @monsieurtanuki!

Thank you @g123k for your review! If you have time please consider reviewing openfoodfacts/smooth-app#4746 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Default productName and languages
3 participants