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: support for accented language less taxonomy entries + images #8218

Merged
merged 6 commits into from
Mar 16, 2023

Conversation

stephanegigandet
Copy link
Contributor

Fixes #8212
Fixes #8217

This PR:

  • makes the "wildcard language" xx: an unaccented language.
  • solves the issue of images for accented taxonomy entries
  • adds tests

image

@stephanegigandet stephanegigandet requested a review from a team as a code owner March 16, 2023 11:59
@github-actions github-actions bot added config Tags 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests 🧪 unit tests labels Mar 16, 2023
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Perfect !

(ok 90% perfect, as you didn't add tests on get_tag_image 😉 )

Comment on lines +693 to +698
# Add a version string to the taxonomy data
# Change this version string if you want to force the taxonomies to be rebuilt
# e.g. if the taxonomy building algorithm or configuration has changed
# This needs to be done also when the unaccenting parameters for languages set in Config.pm are changed

$sha1->add("20230316 - made xx: unaccented");
Copy link
Member

Choose a reason for hiding this comment

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

Very good idea :-)

@stephanegigandet
Copy link
Contributor Author

(ok 90% perfect, as you didn't add tests on get_tag_image wink )

@alexgarel Actually there are 2, and one of them is failing... :-(

# Tags images
is(get_tag_image("en", "labels", "usda-organic"), "/images/lang/en/labels/usda-organic.90x90.svg");
is(get_tag_image("sv", "labels", "sv:ä-märket"), "/images/lang/sv/labels/ä-märket.141x90.png");

@codecov-commenter
Copy link

Codecov Report

Merging #8218 (f342d91) into main (65f8415) will increase coverage by 0.06%.
The diff coverage is 97.05%.

@@            Coverage Diff             @@
##             main    #8218      +/-   ##
==========================================
+ Coverage   46.99%   47.06%   +0.06%     
==========================================
  Files         104      104              
  Lines       20437    20448      +11     
  Branches     4650     4650              
==========================================
+ Hits         9604     9623      +19     
+ Misses       9684     9678       -6     
+ Partials     1149     1147       -2     
Impacted Files Coverage Δ
lib/ProductOpener/Tags.pm 54.04% <94.73%> (+0.43%) ⬆️
tests/unit/tags.t 88.75% <100.00%> (+0.64%) ⬆️

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Tags 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests 🧪 unit tests
Projects
None yet
3 participants