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

Ingredient quantities: allow conversion into imperial units. #252

Open
jayaddison opened this issue Apr 11, 2024 · 1 comment
Open

Ingredient quantities: allow conversion into imperial units. #252

jayaddison opened this issue Apr 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jayaddison
Copy link
Member

Is your feature request related to a problem? Please describe.
This is based on a user feedback enquiry received recently; it would be useful to allow ingredient quantities to be displayed in imperial units in addition to the current metric units.

Describe the solution you'd like
There are a few options to consider here.

  • We could imply a unit system based on the user's locale.
  • We could provide per-session configuration setting.
  • We could provide a more persistent configuration setting.

Describe alternatives you've considered
N/A

Additional context
To some extent, the convert-units JavaScript library that the application already depends upon can provide imperial unit conversion. It's aware of the units, although as far as I know there isn't currently a singleton to_imperial or similar conversion method.

The other question is whether that library's imperial unit representations are suitable for use in the context of kitchen recipes. I'll note that it does define an imperial unit for cups, which is something that in one way is reassuring, because it is included, but also potentially a challenge, because that unit tends to have differing definitions in various locales.

@jayaddison jayaddison added the enhancement New feature or request label Apr 11, 2024
@jayaddison
Copy link
Member Author

Additional context
To some extent, the convert-units JavaScript library that the application already depends upon can provide imperial unit conversion. It's aware of the units, although as far as I know there isn't currently a singleton to_imperial or similar conversion method.

The other question is whether that library's imperial unit representations are suitable for use in the context of kitchen recipes. I'll note that it does define an imperial unit for cups, which is something that in one way is reassuring, because it is included, but also potentially a challenge, because that unit tends to have differing definitions in various locales.

The feature-limitations above relate to version 2.3.4 of convert-units, as currently used by this application; however, support for conversion between different measurement systems (for example, metric to imperial) has seems to have been added during the 3.0.0-beta releases. We should attempt an upgrade to one of these; it may provide the functionality we're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant