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: fallback to english for knowledge panels #6804

Merged
merged 3 commits into from
May 30, 2022
Merged

Conversation

alexgarel
Copy link
Member

fixes #6771

@alexgarel alexgarel requested a review from a team as a code owner May 20, 2022 15:06
@github-actions github-actions bot added Display 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels Tags labels May 20, 2022
@@ -407,7 +407,7 @@ sub process_template($$$) {

# Display one taxonomy entry in the target language
$template_data_ref->{display_taxonomy_tag} = sub ($$) {
return display_taxonomy_tag($lc, $_[0], $_[1]);
return display_taxonomy_tag_name($lc, $_[0], $_[1]);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is ok I guess, I don't think we have templates where we do want the tag with the leading language code. We might in the future though, e.g. if we want to use panels to link to a list of products with a specific tag.

Another option is to change display_taxonomy_tag to display_taxonomy_tag_name in all templates.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will change to have a specific display_taxonomy_tag_name available in templates

Copy link
Member Author

Choose a reason for hiding this comment

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

I've change that, to instead have two function and use appropriate one in knowledge panels.

@github-actions github-actions bot added the Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. label May 24, 2022
Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@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
0.0% 0.0% Duplication

@alexgarel alexgarel merged commit 43712b5 into main May 30, 2022
@alexgarel alexgarel deleted the fix-kp-translations branch May 30, 2022 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Display 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels Tags Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes.
Projects
Development

Successfully merging this pull request may close these issues.

2 participants