nutritionix / nutrition-label

Create a FDA-style nutrition label with any nutrition data source (even the Nutritionix API - http://www.nutritionix.com/api)
http://www.nutritionix.com/
MIT License
176 stars 66 forks source link

make the remaining hard-coded texts customizable by adding them on the settings #112

Closed majin22 closed 5 years ago

majin22 commented 5 years ago

upon inspection of the code, i found a few values that are still hard coded

the new setting values are

unitServingWeight : '<span aria-hidden="true">g</span><span class="sr-only"> grams</span>', //this is for the 2018 version
textUKPer100 : 'Per', //this is for the uk version
textUKDefaultServingNameIfEmpty : 'Serving', //this is for the uk version
textDataNotAvailable : 'Data not available',
textAriaLabelIncreaseQuantityArrow : 'Increase the Quantity Arrow',
textAriaLabelDecreaseQuantityArrow : 'Decrease the Quantity Arrow',
textAriaLabelChangeQuantityTextbox : 'Change the Quantity Textbox',
textCalorieDietHtmlLegacyLessThan : 'Less than',
textCalorieDietHtmlLegacyDietary : 'Dietary',

and also to fix an issue with the 2018 label where Amount per serving is hard-coded instead of using the setting textAmountPerServing

on the image below, only Per and Data not available are not yet included in the setting Taco Bell Nutrition Calculator   Calories  Nutrition Facts  Allergy

majin22 commented 5 years ago

@Yurko-Fedoriv I just want to let you know that a new version has been published. thanks