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: adding the rest ofthe nutrition properties from schema.org #4301

Conversation

tjb1982
Copy link
Contributor

@tjb1982 tjb1982 commented Oct 1, 2024

What type of PR is this?

  • feature

What this PR does / why we need it:

Some of the most important schema.org nutrition properties were missing. (See https://schema.org/NutritionInformation)

This adds the remaining ones from schema.org, except for servingSize which would cause problems with the current design wrt translating the unit of measure, which is variable. It's also easy to confuse the servingSize (i.e., "500 g", "4 cups", etc.) concept with the existing and unrelated "servings" (i.e., "serves 4") scaling concept, so I left it out (for now?).

In the future it might be nice to allow an EAV type of design to allow users to create arbitrary nutrition entries, but that's more difficult and definitely an edge-case. Out of scope for this regardless.

update: added tests and updated cleaner, migration services, etc.

Which issue(s) this PR fixes:

N/A

Testing

Manually tested with the following URL import: https://www.twopeasandtheirpod.com/vegetarian-taco-skillet/

This recipe included saturated fat and cholesterol.

Updated autoated unit/integration tests to account for these new entries.

@tjb1982
Copy link
Contributor Author

tjb1982 commented Oct 1, 2024

Another thing I forgot to mention is that I don't know what to do for crowdin translations. I updated the en-US for the affected front-end messages with the assumption that en-US is the source for the rest of the translations (I think I saw that configured somewhere). But that will need to be run at some point if this PR is accepted.

@tjb1982
Copy link
Contributor Author

tjb1982 commented Oct 1, 2024

image

@Kuchenpirat
Copy link
Collaborator

Another thing I forgot to mention is that I don't know what to do for crowdin translations. I updated the en-US for the affected front-end messages with the assumption that en-US is the source for the rest of the translations (I think I saw that configured somewhere). But that will need to be run at some point if this PR is accepted.

You just need to update the en-US file. Everything else will be handled by Crowdin automatically 👍

@tjb1982 tjb1982 marked this pull request as ready for review October 2, 2024 19:12
@tjb1982 tjb1982 force-pushed the feat/more-nutrition-from-schema.org branch 4 times, most recently from 404f9a2 to becbb2d Compare October 9, 2024 01:52
@tjb1982 tjb1982 force-pushed the feat/more-nutrition-from-schema.org branch 2 times, most recently from 860d1f0 to 58ac1fd Compare October 12, 2024 12:31
@tjb1982 tjb1982 force-pushed the feat/more-nutrition-from-schema.org branch from 58ac1fd to d525f5f Compare October 13, 2024 11:35
Copy link
Collaborator

@Kuchenpirat Kuchenpirat left a comment

Choose a reason for hiding this comment

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

Hey, thanks for your contribution to mealie.
Looks all good 👍

Sorry it took me a bit longer to get to it.

@Kuchenpirat Kuchenpirat merged commit 02c0fe9 into mealie-recipes:mealie-next Oct 13, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants