fix translation on ModelListMenu

This commit is contained in:
Chris Scoggins
2022-01-26 15:00:21 -06:00
parent 4a48019885
commit 6e4bb64b4e
3 changed files with 26 additions and 26 deletions

View File

@ -18,7 +18,7 @@
<h3> <h3>
<!-- <span><b-button variant="link" size="sm" class="text-dark shadow-none"><i class="fas fa-chevron-down"></i></b-button></span> --> <!-- <span><b-button variant="link" size="sm" class="text-dark shadow-none"><i class="fas fa-chevron-down"></i></b-button></span> -->
<model-menu /> <model-menu />
<span>{{ this.this_model.name }}</span> <span>{{ $t(this.this_model.name) }}</span>
<span v-if="apiName !== 'Step'"> <span v-if="apiName !== 'Step'">
<b-button variant="link" @click="startAction({ action: 'new' })"> <b-button variant="link" @click="startAction({ action: 'new' })">
<i class="fas fa-plus-circle fa-2x"></i> <i class="fas fa-plus-circle fa-2x"></i>

View File

@ -5,21 +5,21 @@
<template #button-content> <template #button-content>
<i class="fas fa-chevron-down"></i> <i class="fas fa-chevron-down"></i>
</template> </template>
<b-dropdown-item :href="resolveDjangoUrl('list_food')"> <i class="fas fa-leaf fa-fw"></i> {{ Models["FOOD"].name }} </b-dropdown-item> <b-dropdown-item :href="resolveDjangoUrl('list_food')"> <i class="fas fa-leaf fa-fw"></i> {{ $t(Models["FOOD"].name) }} </b-dropdown-item>
<b-dropdown-item :href="resolveDjangoUrl('list_keyword')"> <i class="fas fa-tags fa-fw"></i> {{ Models["KEYWORD"].name }} </b-dropdown-item> <b-dropdown-item :href="resolveDjangoUrl('list_keyword')"> <i class="fas fa-tags fa-fw"></i> {{ $t(Models["KEYWORD"].name) }} </b-dropdown-item>
<b-dropdown-item :href="resolveDjangoUrl('list_unit')"> <i class="fas fa-balance-scale fa-fw"></i> {{ Models["UNIT"].name }} </b-dropdown-item> <b-dropdown-item :href="resolveDjangoUrl('list_unit')"> <i class="fas fa-balance-scale fa-fw"></i> {{ $t(Models["UNIT"].name) }} </b-dropdown-item>
<b-dropdown-item :href="resolveDjangoUrl('list_supermarket')"> <i class="fas fa-store-alt fa-fw"></i> {{ Models["SUPERMARKET"].name }} </b-dropdown-item> <b-dropdown-item :href="resolveDjangoUrl('list_supermarket')"> <i class="fas fa-store-alt fa-fw"></i> {{ $t(Models["SUPERMARKET"].name) }} </b-dropdown-item>
<b-dropdown-item :href="resolveDjangoUrl('list_supermarket_category')"> <i class="fas fa-cubes fa-fw"></i> {{ Models["SHOPPING_CATEGORY"].name }} </b-dropdown-item> <b-dropdown-item :href="resolveDjangoUrl('list_supermarket_category')"> <i class="fas fa-cubes fa-fw"></i> {{ $t(Models["SHOPPING_CATEGORY"].name) }} </b-dropdown-item>
<b-dropdown-item :href="resolveDjangoUrl('list_automation')"> <i class="fas fa-robot fa-fw"></i> {{ Models["AUTOMATION"].name }} </b-dropdown-item> <b-dropdown-item :href="resolveDjangoUrl('list_automation')"> <i class="fas fa-robot fa-fw"></i> {{ $t(Models["AUTOMATION"].name) }} </b-dropdown-item>
<b-dropdown-item :href="resolveDjangoUrl('list_user_file')"> <i class="fas fa-file fa-fw"></i> {{ Models["USERFILE"].name }} </b-dropdown-item> <b-dropdown-item :href="resolveDjangoUrl('list_user_file')"> <i class="fas fa-file fa-fw"></i> {{ $t(Models["USERFILE"].name) }} </b-dropdown-item>
<b-dropdown-item :href="resolveDjangoUrl('list_step')"> <i class="fas fa-puzzle-piece fa-fw"></i>{{ Models["STEP"].name }} </b-dropdown-item> <b-dropdown-item :href="resolveDjangoUrl('list_step')"> <i class="fas fa-puzzle-piece fa-fw"></i>{{ $t(Models["STEP"].name) }} </b-dropdown-item>
</b-dropdown> </b-dropdown>
</span> </span>
</template> </template>

View File

@ -59,7 +59,7 @@ export class Models {
// MODELS - inherits and takes precedence over MODEL_TYPES and ACTIONS // MODELS - inherits and takes precedence over MODEL_TYPES and ACTIONS
static FOOD = { static FOOD = {
name: i18n.t("Food"), // *OPTIONAL* : parameters will be built model -> model_type -> default name: "Food", // *OPTIONAL* : parameters will be built model -> model_type -> default
apiName: "Food", // *REQUIRED* : the name that is used in api.ts for this model apiName: "Food", // *REQUIRED* : the name that is used in api.ts for this model
model_type: this.TREE, // *OPTIONAL* : model specific params for api, if not present will attempt modeltype_create then default_create model_type: this.TREE, // *OPTIONAL* : model specific params for api, if not present will attempt modeltype_create then default_create
paginated: true, paginated: true,
@ -143,12 +143,12 @@ export class Models {
}, },
} }
static FOOD_INHERIT_FIELDS = { static FOOD_INHERIT_FIELDS = {
name: i18n.t("FoodInherit"), name: "FoodInherit",
apiName: "FoodInheritField", apiName: "FoodInheritField",
} }
static KEYWORD = { static KEYWORD = {
name: i18n.t("Keyword"), // *OPTIONAL: parameters will be built model -> model_type -> default name: "Keyword", // *OPTIONAL: parameters will be built model -> model_type -> default
apiName: "Keyword", apiName: "Keyword",
model_type: this.TREE, model_type: this.TREE,
paginated: true, paginated: true,
@ -191,7 +191,7 @@ export class Models {
} }
static UNIT = { static UNIT = {
name: i18n.t("Unit"), name: "Unit",
apiName: "Unit", apiName: "Unit",
paginated: true, paginated: true,
create: { create: {
@ -217,7 +217,7 @@ export class Models {
} }
static SHOPPING_LIST = { static SHOPPING_LIST = {
name: i18n.t("Shopping_list"), name: "Shopping_list",
apiName: "ShoppingListEntry", apiName: "ShoppingListEntry",
list: { list: {
params: ["id", "checked", "supermarket", "options"], params: ["id", "checked", "supermarket", "options"],
@ -246,7 +246,7 @@ export class Models {
} }
static RECIPE_BOOK = { static RECIPE_BOOK = {
name: i18n.t("Recipe_Book"), name: "Recipe_Book",
apiName: "RecipeBook", apiName: "RecipeBook",
create: { create: {
params: [["name", "description", "icon"]], params: [["name", "description", "icon"]],
@ -276,7 +276,7 @@ export class Models {
} }
static SHOPPING_CATEGORY = { static SHOPPING_CATEGORY = {
name: i18n.t("Shopping_Category"), name: "Shopping_Category",
apiName: "SupermarketCategory", apiName: "SupermarketCategory",
create: { create: {
params: [["name", "description"]], params: [["name", "description"]],
@ -300,7 +300,7 @@ export class Models {
} }
static SHOPPING_CATEGORY_RELATION = { static SHOPPING_CATEGORY_RELATION = {
name: i18n.t("Shopping_Category_Relation"), name: "Shopping_Category_Relation",
apiName: "SupermarketCategoryRelation", apiName: "SupermarketCategoryRelation",
create: { create: {
params: [["category", "supermarket", "order"]], params: [["category", "supermarket", "order"]],
@ -324,7 +324,7 @@ export class Models {
} }
static SUPERMARKET = { static SUPERMARKET = {
name: i18n.t("Supermarket"), name: "Supermarket",
apiName: "Supermarket", apiName: "Supermarket",
ordered_tags: [{ field: "category_to_supermarket", label: "category::name", color: "info" }], ordered_tags: [{ field: "category_to_supermarket", label: "category::name", color: "info" }],
create: { create: {
@ -367,7 +367,7 @@ export class Models {
} }
static AUTOMATION = { static AUTOMATION = {
name: i18n.t("Automation"), name: "Automation",
apiName: "Automation", apiName: "Automation",
paginated: true, paginated: true,
list: { list: {
@ -430,7 +430,7 @@ export class Models {
} }
static RECIPE = { static RECIPE = {
name: i18n.t("Recipe"), name: "Recipe",
apiName: "Recipe", apiName: "Recipe",
list: { list: {
params: ["query", "keywords", "foods", "units", "rating", "books", "keywordsOr", "foodsOr", "booksOr", "internal", "random", "_new", "page", "pageSize", "options"], params: ["query", "keywords", "foods", "units", "rating", "books", "keywordsOr", "foodsOr", "booksOr", "internal", "random", "_new", "page", "pageSize", "options"],
@ -446,7 +446,7 @@ export class Models {
} }
static USER_NAME = { static USER_NAME = {
name: i18n.t("User"), name: "User",
apiName: "User", apiName: "User",
list: { list: {
params: ["filter_list"], params: ["filter_list"],
@ -454,7 +454,7 @@ export class Models {
} }
static MEAL_TYPE = { static MEAL_TYPE = {
name: i18n.t("Meal_Type"), name: "Meal_Type",
apiName: "MealType", apiName: "MealType",
list: { list: {
params: ["filter_list"], params: ["filter_list"],
@ -462,7 +462,7 @@ export class Models {
} }
static MEAL_PLAN = { static MEAL_PLAN = {
name: i18n.t("Meal_Plan"), name: "Meal_Plan",
apiName: "MealPlan", apiName: "MealPlan",
list: { list: {
params: ["options"], params: ["options"],
@ -470,7 +470,7 @@ export class Models {
} }
static USERFILE = { static USERFILE = {
name: i18n.t("File"), name: "File",
apiName: "UserFile", apiName: "UserFile",
paginated: false, paginated: false,
list: { list: {
@ -499,13 +499,13 @@ export class Models {
}, },
} }
static USER = { static USER = {
name: i18n.t("User"), name: "User",
apiName: "User", apiName: "User",
paginated: false, paginated: false,
} }
static STEP = { static STEP = {
name: i18n.t("Step"), name: "Step",
apiName: "Step", apiName: "Step",
list: { list: {
params: ["recipe", "query", "page", "pageSize", "options"], params: ["recipe", "query", "page", "pageSize", "options"],