From 80f88066042508d52911a8540c7b172987a404bf Mon Sep 17 00:00:00 2001 From: sephrat <34862846+sephrat@users.noreply.github.com> Date: Fri, 23 Apr 2021 08:13:00 +0200 Subject: [PATCH] Localize more dates and texts (#341) * Localize more dates and texts * Adapt source language to 4-letter code for VS code * Make page titles more reactive to language change * Translate missing text + fix missed refactoring * Fix missed page titles refactoring * Translate nutrition view * Translate Image upload vue * Fix default text being defined twice in upload btn --- .vscode/settings.json | 2 +- .../src/components/MealPlan/MealPlanNew.vue | 7 +-- .../MealPlan/ShoppingListDialog.vue | 4 +- .../Recipe/RecipeEditor/ImageUploadBtn.vue | 10 ++-- .../Recipe/RecipeEditor/NutritionEditor.vue | 16 +++--- .../components/UI/Buttons/TheUploadBtn.vue | 2 +- .../src/locales/dateTimeFormats/en-US.json | 6 ++ frontend/src/locales/messages/en-US.json | 25 +++++++-- .../Admin/Backup/AvailableBackupCard.vue | 9 +-- .../src/pages/Admin/Backup/BackupCard.vue | 9 +-- .../src/pages/Admin/Backup/ImportDialog.vue | 4 +- .../pages/Admin/Migration/MigrationCard.vue | 7 +-- frontend/src/pages/MealPlan/Planner.vue | 4 -- frontend/src/routes/admin.js | 17 +++--- frontend/src/routes/general.js | 3 +- frontend/src/routes/index.js | 5 +- frontend/src/routes/meal.js | 5 +- frontend/src/utils/index.js | 55 ------------------- 18 files changed, 65 insertions(+), 125 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0b1a8fea81fa..aabf6d50d8b8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,7 +10,7 @@ "python.testing.pytestArgs": ["tests"], "cSpell.enableFiletypes": ["!javascript", "!python"], "i18n-ally.localesPaths": "frontend/src/locales/messages", - "i18n-ally.sourceLanguage": "en", + "i18n-ally.sourceLanguage": "en-US", "i18n-ally.enabledFrameworks": ["vue"], "i18n-ally.keystyle": "nested", "cSpell.words": ["performant"], diff --git a/frontend/src/components/MealPlan/MealPlanNew.vue b/frontend/src/components/MealPlan/MealPlanNew.vue index dd56a0ec7309..39f706ab8b64 100644 --- a/frontend/src/components/MealPlan/MealPlanNew.vue +++ b/frontend/src/components/MealPlan/MealPlanNew.vue @@ -3,7 +3,7 @@ {{ $t("meal-plan.create-a-new-meal-plan") }} - mdi-calendar-minus Quick Week + mdi-calendar-minus {{$t('meal-plan.quick-week')}} @@ -110,7 +110,6 @@ export default { this.meals.push({ slug: "empty", date: this.getDate(i), - dateText: this.getDayText(i), }); } }, @@ -193,10 +192,6 @@ export default { ); return dateText; }, - getDayText(index) { - const dateObj = this.processTime(index); - return utils.getDateAsText(dateObj); - }, getDate(index) { const dateObj = this.processTime(index); return utils.getDateAsPythonDate(dateObj); diff --git a/frontend/src/components/MealPlan/ShoppingListDialog.vue b/frontend/src/components/MealPlan/ShoppingListDialog.vue index b92800d6487c..8bd2da175cba 100644 --- a/frontend/src/components/MealPlan/ShoppingListDialog.vue +++ b/frontend/src/components/MealPlan/ShoppingListDialog.vue @@ -3,10 +3,10 @@ - Shopping List + {{$t('meal-plan.shopping-list')}} - Group (Beta) + {{$t('meal-plan.group')}} diff --git a/frontend/src/components/Recipe/RecipeEditor/ImageUploadBtn.vue b/frontend/src/components/Recipe/RecipeEditor/ImageUploadBtn.vue index fa5dd4c1fe4d..b1d543201f79 100644 --- a/frontend/src/components/Recipe/RecipeEditor/ImageUploadBtn.vue +++ b/frontend/src/components/Recipe/RecipeEditor/ImageUploadBtn.vue @@ -3,13 +3,13 @@
- Recipe Image + {{$t('recipe.recipe-image')}}
- + @@ -46,7 +46,6 @@ const REFRESH_EVENT = "refresh"; const UPLOAD_EVENT = "upload"; import TheUploadBtn from "@/components/UI/Buttons/TheUploadBtn"; import { api } from "@/api"; -// import axios from "axios"; export default { components: { TheUploadBtn, @@ -55,7 +54,6 @@ export default { slug: String, }, data: () => ({ - items: [{ title: "Upload Image" }, { title: "From URL" }], url: "", loading: false, }), diff --git a/frontend/src/components/Recipe/RecipeEditor/NutritionEditor.vue b/frontend/src/components/Recipe/RecipeEditor/NutritionEditor.vue index b74b54b72a97..7050b325017e 100644 --- a/frontend/src/components/Recipe/RecipeEditor/NutritionEditor.vue +++ b/frontend/src/components/Recipe/RecipeEditor/NutritionEditor.vue @@ -1,6 +1,6 @@