Ваш список покупок пуст. Добавьте рецепт, и его ингредиенты появятся здесь.
';
+ html += 'Your shopping list is empty. Add a recipe, and its ingredients will appear here.
';
}
app.dom.shoppingListContainer.innerHTML = html;
@@ -365,21 +365,21 @@ const app = {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
},
- addIngredientRow(ingredient = { name: '', quantity: '', unit: 'г' }) {
+ addIngredientRow(ingredient = { name: '', quantity: '', unit: 'g' }) {
const row = document.createElement('div');
row.className = 'ingredient-row mb-3';
- const units = ['г', 'кг', 'мл', 'л', 'шт', 'уп'];
+ const units = ['g', 'kg', 'ml', 'l', 'piece', 'pack'];
const unitButtons = units.map(u =>
`
-
+
${unitButtons}
@@ -396,9 +396,9 @@ const app = {
app.dom.guestCountInput.value = '1';
app.dom.ingredientsContainer.innerHTML = '';
app.ui.addIngredientRow();
- app.dom.newRecipeBtn.textContent = 'Сохранить рецепт';
+ app.dom.newRecipeBtn.textContent = 'Save Recipe';
app.dom.cancelEditBtn.style.display = 'none';
- document.getElementById('recipe-form-modal-label').textContent = 'Добавить рецепт';
+ document.getElementById('recipe-form-modal-label').textContent = 'Add a Recipe';
},
populateFormForEdit(recipeId) {
const recipe = app.state.recipes.find(r => r.id == recipeId);
@@ -416,9 +416,9 @@ const app = {
app.ui.addIngredientRow();
}
- app.dom.newRecipeBtn.textContent = 'Обновить рецепт';
+ app.dom.newRecipeBtn.textContent = 'Update Recipe';
app.dom.cancelEditBtn.style.display = 'block';
- document.getElementById('recipe-form-modal-label').textContent = 'Изменить рецепт';
+ document.getElementById('recipe-form-modal-label').textContent = 'Edit Recipe';
app.dom.recipeFormModal.show();
app.dom.recipeNameInput.focus();
@@ -442,7 +442,7 @@ const app = {
}
document.getElementById('view-recipe-name').textContent = recipe.name;
- document.getElementById('view-recipe-category').textContent = recipe.category || 'Без категории';
+ document.getElementById('view-recipe-category').textContent = recipe.category || 'No category';
document.getElementById('view-recipe-guests').textContent = recipe.guests;
const ingredientsList = document.getElementById('view-recipe-ingredients');
@@ -501,10 +501,10 @@ const app = {
if (app.state.user) {
nav.innerHTML = `
- Добро пожаловать, ${app.state.user.email}
+ Welcome, ${app.state.user.email}
-
+
`;
if (guestView) guestView.classList.add('d-none');
@@ -579,7 +579,7 @@ const app = {
app.dom.aiScanBtn.addEventListener('click', async function() {
const file = app.dom.recipeImage.files[0];
if (!file) {
- alert('Пожалуйста, сначала выберите изображение.');
+ alert('Please select an image first.');
return;
}
@@ -608,16 +608,16 @@ const app = {
app.ui.addIngredientRow({
name: ing.name || '',
quantity: ing.quantity || '',
- unit: ing.unit || 'г'
+ unit: ing.unit || 'g'
});
});
}
} else {
- alert('Ошибка ИИ сканера: ' + result.error);
+ alert('AI Scan failed: ' + result.error);
}
} catch (error) {
console.error('Error during AI scan:', error);
- alert('Произошла ошибка при сканировании ИИ.');
+ alert('An error occurred during AI scanning.');
} finally {
app.dom.aiScanBtn.disabled = false;
app.dom.aiScanLoading.classList.add('d-none');
@@ -643,7 +643,7 @@ const app = {
app.dom.newRecipeBtn.addEventListener('click', async function() {
const recipeData = app.ui.getRecipeDataFromForm();
if (!recipeData) {
- alert('Пожалуйста, заполните название рецепта, категорию, количество гостей и хотя бы один ингредиент перед сохранением.');
+ alert('Please fill out the recipe name, category, guests, and at least one ingredient before saving.');
return;
}
@@ -679,7 +679,7 @@ const app = {
app.dom.recipeFormModal.hide();
});
} else {
- alert('Не удалось сохранить рецепт: ' + data.error);
+ alert('Failed to save recipe: ' + data.error);
}
});
@@ -691,7 +691,7 @@ const app = {
const recipeId = card.getAttribute('data-id');
if (target && target.classList.contains('delete-recipe')) {
- if (confirm('Вы уверены, что хотите удалить этот рецепт?')) {
+ if (confirm('Are you sure you want to delete this recipe?')) {
app.api.deleteRecipe(recipeId);
}
}
@@ -745,7 +745,7 @@ const app = {
name: properName,
quantity: 0,
unit: unit,
- source: 'Дополнительный продукт'
+ source: 'Additional product'
};
app.state.additionalProducts.push(productToModify);
}
@@ -769,7 +769,7 @@ const app = {
name: properName,
quantity: 0,
unit: unit,
- source: 'Дополнительный продукт'
+ source: 'Additional product'
};
app.state.additionalProducts.push(productToModify);
}
@@ -885,7 +885,7 @@ const app = {
const category = app.dom.productCategory.value;
if (!name || isNaN(quantity) || quantity <= 0 || !unit) {
- alert('Пожалуйста, заполните все поля корректными значениями.');
+ alert('Please fill out all fields with valid values.');
return;
}
@@ -899,7 +899,7 @@ const app = {
if (existingProduct) {
existingProduct.quantity += quantity;
} else {
- const newProduct = { name, quantity, unit, source: 'Дополнительный продукт', category: category };
+ const newProduct = { name, quantity, unit, source: 'Additional product', category: category };
app.state.additionalProducts.push(newProduct);
}
diff --git a/index.php b/index.php
index 0c7026f..641c393 100644
--- a/index.php
+++ b/index.php
@@ -5,20 +5,20 @@
-
SmartRecipe — Умный помощник по рецептам и покупкам
-
-
+
Smart Recipe & Shopping List
+
+
-
-
+
+
-
-
+
+
@@ -27,7 +27,7 @@
-
+
@@ -36,7 +36,7 @@
- СмартРецепт
+ SmartRecipe