This pull request refactors the code and data related to meal options in the rogue-thi-app. It replaces the term variations with variants for consistency and readability. It also improves the logic and translation of meal names and variants from different sources. It affects several files in the data, lib, pages, public, and styles directories.
We are the variants, we rise from the dataWe break the variations, we defy the schemaWe merge and unify, we create the planWe are the variants, we feed the hungry man
Walkthrough
Refactored the JSON data for Reimanns meals to use variants instead of variations as the property name for the different options of a meal (link,link,link,link)
Imported stop-words.json in food-utils.js to remove common words from meal names when merging them into variants (link)
Modified unifyFoodEntries in food-utils.js to use a helper function unifyMeal that unifies a single meal to a common format, and added a new property additional to the unified meal format (link)
Modified translateFallback and translateMeals in translation-utils.js to also translate the variants of a meal, if any, using the same logic as the main meal name (link,link)
Modified fetchPlan in canisius.js and mensa.js to use mergeMealvariants from food-utils.js to merge meals with a similar name and same category into one meal with variants, before translating and unifying them (link,link,link,link)
Renamed renderFoodVariations to renderFoodvariants in food.jsx and changed the CSS class name variations to variants in the elements that render the meal variants, nutrition information, and prices (link,link,link,link,link)
Changed the translation key variations to variants in the German and English locale files (link,link)
Changed the CSS class name variations to variants in Mensa.module.css (link)
New Meal Page
🤖 Generated by Copilot at 01247d9
Summary
🔄🍽️🛠️
This pull request refactors the code and data related to meal options in the rogue-thi-app. It replaces the term
variations
withvariants
for consistency and readability. It also improves the logic and translation of meal names and variants from different sources. It affects several files in thedata
,lib
,pages
,public
, andstyles
directories.Walkthrough
variants
instead ofvariations
as the property name for the different options of a meal (link,link,link,link)stop-words.json
infood-utils.js
to remove common words from meal names when merging them into variants (link)unifyFoodEntries
infood-utils.js
to use a helper functionunifyMeal
that unifies a single meal to a common format, and added a new propertyadditional
to the unified meal format (link)translateFallback
andtranslateMeals
intranslation-utils.js
to also translate the variants of a meal, if any, using the same logic as the main meal name (link,link)fetchPlan
incanisius.js
andmensa.js
to usemergeMealvariants
fromfood-utils.js
to merge meals with a similar name and same category into one meal with variants, before translating and unifying them (link,link,link,link)renderFoodVariations
torenderFoodvariants
infood.jsx
and changed the CSS class namevariations
tovariants
in the elements that render the meal variants, nutrition information, and prices (link,link,link,link,link)variations
tovariants
in the German and English locale files (link,link)variations
tovariants
inMensa.module.css
(link)