Localize hard-coded texts (#2044)

* feat(lang): localize some views

* feat(lang): an attempt at localizing vuetify (WIP)

* feat(lang): localized some more screens

* feat(lang): localized some more screens again

* feat(lang): hack to localize vuetify

* feat(lang): localize data management pages

* fix linting errors

---------

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
sephrat
2023-01-29 02:39:51 +01:00
committed by GitHub
parent 754d4c3937
commit f8b8680b45
55 changed files with 695 additions and 393 deletions

View File

@@ -1,11 +1,9 @@
<template>
<div>
<div>
<v-card-title class="headline"> Recipe Bulk Importer </v-card-title>
<v-card-title class="headline"> {{ $t('recipe.recipe-bulk-importer') }} </v-card-title>
<v-card-text>
The Bulk recipe importer allows you to import multiple recipes at once by queueing the sites on the backend and
running the task in the background. This can be useful when initially migrating to Mealie, or when you want to
import a large number of recipes.
{{ $t('recipe.recipe-bulk-importer-description') }}
</v-card-text>
</div>
<section class="mt-2">
@@ -85,24 +83,24 @@
<RecipeDialogBulkAdd v-model="bulkDialog" @bulk-data="assignUrls" />
</v-card-actions>
<div class="px-1">
<v-checkbox v-model="showCatTags" hide-details label="Set Categories and Tags " />
<v-checkbox v-model="showCatTags" hide-details :label="$t('recipe.set-categories-and-tags')" />
</div>
<v-card-actions class="justify-end">
<BaseButton :disabled="bulkUrls.length === 0 || lockBulkImport" @click="bulkCreate">
<template #icon> {{ $globals.icons.check }} </template>
Submit
{{ $t('general.submit') }}
</BaseButton>
</v-card-actions>
</section>
<section class="mt-12">
<BaseCardSectionTitle title="Bulk Imports"> </BaseCardSectionTitle>
<BaseCardSectionTitle :title="$tc('recipe.bulk-imports')"> </BaseCardSectionTitle>
<ReportTable :items="reports" @delete="deleteReport" />
</section>
</div>
</template>
<script lang="ts">
import { defineComponent, reactive, toRefs, ref } from "@nuxtjs/composition-api";
import { defineComponent, reactive, toRefs, ref, useContext } from "@nuxtjs/composition-api";
import { whenever } from "@vueuse/shared";
import { useUserApi } from "~/composables/api";
import { alert } from "~/composables/use-toast";
@@ -128,6 +126,7 @@ export default defineComponent({
);
const api = useUserApi();
const { i18n } = useContext();
const bulkUrls = ref([{ url: "", categories: [], tags: [] }]);
const lockBulkImport = ref(false);
@@ -140,10 +139,10 @@ export default defineComponent({
const { response } = await api.recipes.createManyByUrl({ imports: bulkUrls.value });
if (response?.status === 202) {
alert.success("Bulk Import process has started");
alert.success(i18n.tc("recipe.bulk-import-process-has-started"));
lockBulkImport.value = true;
} else {
alert.error("Bulk import process has failed");
alert.error(i18n.tc("recipe.bulk-import-process-has-failed"));
}
fetchReports();
@@ -166,7 +165,7 @@ export default defineComponent({
if (response?.status === 200) {
fetchReports();
} else {
alert.error("Report deletion failed");
alert.error(i18n.tc("recipe.report-deletion-failed"));
}
}