1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-26 00:29:43 +02:00

More localization (#358)

* Translate missing items on About page

* Localize import summary dialog

* Make site menu translation reactive

* Localize import options

* Include semi colon in string

* Move API texts to frontend + better status codes

* Provide feedback to user when no meal is planned

* Fix API tests after latest rework

* Add warning for API changes in changelog

* Refactor API texts handling

* Refactor API texts handling #2

* Better API feedback

* Rearrange strings hierarchy

* Add messages upon recipe updated

* Fix 'recipe effected' typo

* Remove snackbar usage in backend

* Translate toolbox

* Provide feedback for tags CRUD

* Fix messed up merge

* Translate sign-up form

* Better feedback for sign-up CRUD

* Refactor log-in API texts handling

* No error message when user is not authenticated

* Remove unimportant console log
This commit is contained in:
sephrat 2021-04-29 18:22:45 +02:00 committed by GitHub
parent 861020ffe0
commit 1e5edc7434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 890 additions and 606 deletions

View file

@ -80,6 +80,8 @@ import RecipeEditor from "@/components/Recipe/RecipeEditor";
import RecipeTimeCard from "@/components/Recipe/RecipeTimeCard.vue";
import EditorButtonRow from "@/components/Recipe/EditorButtonRow";
import { user } from "@/mixins/user";
import store from "@/store";
import { router } from "@/routes";
export default {
components: {
@ -166,8 +168,12 @@ export default {
return api.recipes.recipeImage(image) + "&rnd=" + this.imageKey;
}
},
deleteRecipe() {
api.recipes.delete(this.recipeDetails.slug);
async deleteRecipe() {
let response = await api.recipes.delete(this.recipeDetails.slug);
if (response) {
store.dispatch("requestRecentRecipes");
router.push(`/`);
}
},
validateRecipe() {
if (this.jsonEditor) {
@ -176,18 +182,19 @@ export default {
return this.$refs.recipeEditor.validateRecipe();
}
},
async saveImage() {
async saveImage(overrideSuccessMsg = false) {
if (this.fileObject) {
await api.recipes.updateImage(this.recipeDetails.slug, this.fileObject);
if (api.recipes.updateImage(this.recipeDetails.slug, this.fileObject, overrideSuccessMsg)) {
this.imageKey += 1;
}
}
this.imageKey += 1;
},
async saveRecipe() {
if (this.validateRecipe()) {
let slug = await api.recipes.update(this.recipeDetails);
if (this.fileObject) {
this.saveImage();
this.saveImage(true);
}
this.form = false;