diff --git a/cookbook/migrations/0185_food_plural_name_ingredient_always_use_plural_food_and_more.py b/cookbook/migrations/0185_food_plural_name_ingredient_always_use_plural_food_and_more.py
new file mode 100644
index 000000000..f29ec9d28
--- /dev/null
+++ b/cookbook/migrations/0185_food_plural_name_ingredient_always_use_plural_food_and_more.py
@@ -0,0 +1,38 @@
+# Generated by Django 4.0.8 on 2022-11-22 06:34
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('cookbook', '0184_alter_userpreference_image'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='food',
+ name='plural_name',
+ field=models.CharField(blank=True, default=None, max_length=128, null=True),
+ ),
+ migrations.AddField(
+ model_name='ingredient',
+ name='always_use_plural_food',
+ field=models.BooleanField(default=False),
+ ),
+ migrations.AddField(
+ model_name='ingredient',
+ name='always_use_plural_unit',
+ field=models.BooleanField(default=False),
+ ),
+ migrations.AddField(
+ model_name='space',
+ name='use_plural',
+ field=models.BooleanField(default=False),
+ ),
+ migrations.AddField(
+ model_name='unit',
+ name='plural_name',
+ field=models.CharField(blank=True, default=None, max_length=128, null=True),
+ ),
+ ]
diff --git a/vue/src/apps/ModelListView/ModelListView.vue b/vue/src/apps/ModelListView/ModelListView.vue
index 4be8b693c..37d417c9b 100644
--- a/vue/src/apps/ModelListView/ModelListView.vue
+++ b/vue/src/apps/ModelListView/ModelListView.vue
@@ -23,8 +23,7 @@
-
+
diff --git a/vue/src/apps/RecipeView/RecipeView.vue b/vue/src/apps/RecipeView/RecipeView.vue
index 2b1e3b9b8..53386c084 100644
--- a/vue/src/apps/RecipeView/RecipeView.vue
+++ b/vue/src/apps/RecipeView/RecipeView.vue
@@ -90,6 +90,7 @@
:ingredient_factor="ingredient_factor"
:servings="servings"
:header="true"
+ :use_plural="use_plural"
id="ingredient_container"
@checked-state-changed="updateIngredientCheckedState"
@change-servings="servings = $event"
@@ -123,6 +124,7 @@
:step="s"
:ingredient_factor="ingredient_factor"
:index="index"
+ :use_plural="use_plural"
:start_time="start_time"
@update-start-time="updateStartTime"
@checked-state-changed="updateIngredientCheckedState"
@@ -179,6 +181,7 @@ import KeywordsComponent from "@/components/KeywordsComponent"
import NutritionComponent from "@/components/NutritionComponent"
import RecipeSwitcher from "@/components/Buttons/RecipeSwitcher"
import CustomInputSpinButton from "@/components/CustomInputSpinButton"
+import {ApiApiFactory} from "@/utils/openapi/api";
Vue.prototype.moment = moment
@@ -218,6 +221,7 @@ export default {
},
data() {
return {
+ use_plural: false,
loading: true,
recipe: undefined,
rootrecipe: undefined,
@@ -226,7 +230,7 @@ export default {
start_time: "",
share_uid: window.SHARE_UID,
wake_lock: null,
- ingredient_height: '250'
+ ingredient_height: '250',
}
},
watch: {
@@ -239,6 +243,11 @@ export default {
this.$i18n.locale = window.CUSTOM_LOCALE
this.requestWakeLock()
window.addEventListener('resize', this.handleResize);
+
+ let apiClient = new ApiApiFactory()
+ apiClient.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => {
+ this.use_plural = r.data.use_plural
+ })
},
beforeUnmount() {
this.destroyWakeLock()
diff --git a/vue/src/components/IngredientComponent.vue b/vue/src/components/IngredientComponent.vue
index cbb7c91be..cb5de51ce 100644
--- a/vue/src/components/IngredientComponent.vue
+++ b/vue/src/components/IngredientComponent.vue
@@ -18,11 +18,11 @@
- {{ ingredient.unit.name }}
+ {{ ingredient.unit.name }}
- {{ ingredient.unit.name }}
+ {{ ingredient.unit.name }}
{{ ingredient.unit.plural_name}}
diff --git a/vue/src/components/StepComponent.vue b/vue/src/components/StepComponent.vue
index 453fec1dc..11f5714d2 100644
--- a/vue/src/components/StepComponent.vue
+++ b/vue/src/components/StepComponent.vue
@@ -35,7 +35,7 @@
@@ -90,6 +90,7 @@
:index="index"
:start_time="start_time"
:force_ingredients="true"
+ :use_plural="use_plural"
>
@@ -149,6 +150,10 @@ export default {
type: Boolean,
default: false,
},
+ use_plural: {
+ type: Boolean,
+ default: false,
+ },
},
computed: {
step_time: function() {
|