diff --git a/frontend/lang/messages/en-US.json b/frontend/lang/messages/en-US.json
index 77d831619..46f6f573c 100644
--- a/frontend/lang/messages/en-US.json
+++ b/frontend/lang/messages/en-US.json
@@ -1134,7 +1134,19 @@
"example-unit-singular": "ex: Tablespoon",
"example-unit-plural": "ex: Tablespoons",
"example-unit-abbreviation-singular": "ex: Tbsp",
- "example-unit-abbreviation-plural": "ex: Tbsps"
+ "example-unit-abbreviation-plural": "ex: Tbsps",
+ "standardization": "Standardization",
+ "unit-conversion": "Unit Conversion",
+ "standard-unit-labels": {
+ "fluid-ounce": "fluid ounce",
+ "cup": "cup",
+ "ounce": "ounce",
+ "pound": "pound",
+ "milliliter": "milliliter",
+ "liter": "liter",
+ "gram": "gram",
+ "kilogram": "kilogram"
+ }
},
"labels": {
"seed-dialog-text": "Seed the database with common labels based on your local language.",
diff --git a/frontend/lib/api/types/non-generated.ts b/frontend/lib/api/types/non-generated.ts
index 84f9ff7fe..3970f1859 100644
--- a/frontend/lib/api/types/non-generated.ts
+++ b/frontend/lib/api/types/non-generated.ts
@@ -58,3 +58,13 @@ export interface QueryFilterJSONPart {
relationalOperator?: RelationalKeyword | RelationalOperator | null;
value?: string | string[] | null;
}
+
+export type StandardizedUnitType
+ = | "fluid ounce"
+ | "cup"
+ | "ounce"
+ | "pound"
+ | "milliliter"
+ | "liter"
+ | "gram"
+ | "kilogram";
diff --git a/frontend/pages/group/data/units.vue b/frontend/pages/group/data/units.vue
index 18f87292c..08abeed49 100644
--- a/frontend/pages/group/data/units.vue
+++ b/frontend/pages/group/data/units.vue
@@ -88,6 +88,34 @@
hide-details
:label="$t('data-pages.units.use-abbreviation')"
/>
+
+
+ {{ $t('data-pages.units.standardization') }}
+
+
+ {{ $t('data-pages.units.unit-conversion') }}
+
+
+
+
+
@@ -149,6 +177,34 @@
hide-details
:label="$t('data-pages.units.use-abbreviation')"
/>
+
+
+ {{ $t('data-pages.units.standardization') }}
+
+
+ {{ $t('data-pages.units.unit-conversion') }}
+
+
+
+
+
@@ -314,11 +370,17 @@ import RecipeDataAliasManagerDialog from "~/components/Domain/Recipe/RecipeDataA
import { validators } from "~/composables/use-validators";
import { useUserApi } from "~/composables/api";
import type { CreateIngredientUnit, IngredientUnit, IngredientUnitAlias } from "~/lib/api/types/recipe";
+import type { StandardizedUnitType } from "~/lib/api/types/non-generated";
import { useLocales } from "~/composables/use-locales";
import { normalizeFilter } from "~/composables/use-utils";
import { useUnitStore } from "~/composables/store";
import type { VForm } from "~/types/auto-forms";
+interface StandardUnitItem {
+ title: string;
+ value: StandardizedUnitType;
+};
+
export default defineNuxtComponent({
components: { RecipeDataAliasManagerDialog },
setup() {
@@ -376,6 +438,16 @@ export default defineNuxtComponent({
show: true,
sortable: true,
},
+ {
+ text: i18n.t("data-pages.units.standard-quantity"),
+ value: "standardQuantity",
+ show: false,
+ },
+ {
+ text: i18n.t("data-pages.units.standard-unit"),
+ value: "standardUnit",
+ show: false,
+ },
{
text: i18n.t("general.date-added"),
value: "createdAt",
@@ -384,6 +456,41 @@ export default defineNuxtComponent({
},
];
+ const standardUnitItems = computed(() => [
+ {
+ title: i18n.t("data-pages.units.standard-unit-labels.fluid-ounce"),
+ value: "fluid ounce",
+ },
+ {
+ title: i18n.t("data-pages.units.standard-unit-labels.cup"),
+ value: "cup",
+ },
+ {
+ title: i18n.t("data-pages.units.standard-unit-labels.ounce"),
+ value: "ounce",
+ },
+ {
+ title: i18n.t("data-pages.units.standard-unit-labels.pound"),
+ value: "pound",
+ },
+ {
+ title: i18n.t("data-pages.units.standard-unit-labels.milliliter"),
+ value: "milliliter",
+ },
+ {
+ title: i18n.t("data-pages.units.standard-unit-labels.liter"),
+ value: "liter",
+ },
+ {
+ title: i18n.t("data-pages.units.standard-unit-labels.gram"),
+ value: "gram",
+ },
+ {
+ title: i18n.t("data-pages.units.standard-unit-labels.kilogram"),
+ value: "kilogram",
+ },
+ ]);
+
const { store, actions: unitActions } = useUnitStore();
// ============================================================
@@ -536,6 +643,7 @@ export default defineNuxtComponent({
return {
tableConfig,
tableHeaders,
+ standardUnitItems,
store,
validators,
normalizeFilter,