From 4b09497c3d73fe810617e2bdd94b438b2a13134b Mon Sep 17 00:00:00 2001 From: sephrat <34862846+sephrat@users.noreply.github.com> Date: Wed, 14 Apr 2021 18:06:54 +0200 Subject: [PATCH] Localize custom pages and search page (#299) * Localize custom pages and search page * Fix FR translation for step --- .../Admin/General/CreatePageDialog.vue | 2 +- .../Admin/General/CustomPageCreator.vue | 18 ++++++++--------- .../FormHelpers/CategoryTagSelector.vue | 2 +- frontend/src/locales/messages/en.json | 14 ++++++++++++- frontend/src/locales/messages/fr.json | 20 ++++++++++++++++--- .../src/pages/SearchPage/FilterSelector.vue | 8 ++++---- frontend/src/pages/SearchPage/index.vue | 8 ++++---- 7 files changed, 49 insertions(+), 23 deletions(-) diff --git a/frontend/src/components/Admin/General/CreatePageDialog.vue b/frontend/src/components/Admin/General/CreatePageDialog.vue index 6094f1fe75cb..2754e58d03f8 100644 --- a/frontend/src/components/Admin/General/CreatePageDialog.vue +++ b/frontend/src/components/Admin/General/CreatePageDialog.vue @@ -17,7 +17,7 @@

- Custom Pages + {{$t('settings.custom-pages')}} - Create + {{$t('general.create')}}

@@ -41,11 +41,11 @@ - Delete + {{$t('general.delete')}} - Edit + {{$t('general.edit')}} @@ -55,7 +55,7 @@ - Save + {{$t('general.save')}} @@ -76,8 +76,8 @@ export default { customPages: [], newPageData: { create: true, - title: "New Page", - buttonText: "Create", + title: this.$t('settings.new-page'), + buttonText: this.$t('general.create'), data: { name: "", categories: [], @@ -86,8 +86,8 @@ export default { }, editPageData: { create: false, - title: "Edit Page", - buttonText: "Update", + title: this.$t('settings.edit-page'), + buttonText: this.$t('general.update'), data: {}, }, }; diff --git a/frontend/src/components/FormHelpers/CategoryTagSelector.vue b/frontend/src/components/FormHelpers/CategoryTagSelector.vue index 4abdffe1f10c..c31f0a017389 100644 --- a/frontend/src/components/FormHelpers/CategoryTagSelector.vue +++ b/frontend/src/components/FormHelpers/CategoryTagSelector.vue @@ -90,7 +90,7 @@ export default { computed: { inputLabel() { if (!this.showLabel) return null; - return this.tagSelector ? "Tags" : "Categories"; + return this.tagSelector ? this.$t('recipe.tags') : this.$t('recipe.categories'); }, activeItems() { let ItemObjects = []; diff --git a/frontend/src/locales/messages/en.json b/frontend/src/locales/messages/en.json index 36835625eeb7..4bf311d2a410 100644 --- a/frontend/src/locales/messages/en.json +++ b/frontend/src/locales/messages/en.json @@ -147,6 +147,14 @@ }, "search": { "search-mealie": "Search Mealie", + "search-placeholder": "Search...", + "max-results": "Max Results", + "category-filter": "Category Filter", + "tag-filter": "Tag Filter", + "include": "Include", + "exclude": "Exclude", + "and": "And", + "or": "Or", "search": "Search" }, "settings": { @@ -217,7 +225,11 @@ "site-settings": "Site Settings", "manage-users": "Manage Users", "migrations": "Migrations", - "profile": "Profile" + "profile": "Profile", + "custom-pages": "Custom Pages", + "new-page": "New Page", + "edit-page": "Edit Page", + "page-name": "Page Name" }, "migration": { "recipe-migration": "Recipe Migration", diff --git a/frontend/src/locales/messages/fr.json b/frontend/src/locales/messages/fr.json index 4e56fefcff14..bfeba824c86d 100644 --- a/frontend/src/locales/messages/fr.json +++ b/frontend/src/locales/messages/fr.json @@ -47,6 +47,8 @@ "field-required": "Champ obligatoire", "apply": "Appliquer", "current-parenthesis": "(Actuel)", + "groups": "Groupes", + "users": "Utilisateurs", "about": "À propos" }, "page": { @@ -121,7 +123,7 @@ "categories": "Catégories", "tags": "Tags", "instructions": "Instructions", - "step-index": "Etape: {step}", + "step-index": "Étape : {step}", "recipe-name": "Nom de la recette", "servings": "Portions", "ingredient": "Ingrédient", @@ -145,6 +147,14 @@ }, "search": { "search-mealie": "Rechercher dans Mealie", + "search-placeholder": "Rechercher...", + "and": "Et", + "category-filter": "Filtre par catégories", + "exclude": "Exclure", + "include": "Inclure", + "max-results": "Résultats max", + "or": "Ou", + "tag-filter": "Filtre par tags", "search": "Rechercher" }, "settings": { @@ -187,7 +197,7 @@ }, "webhooks": { "meal-planner-webhooks": "Webhooks du planificateur de repas", - "the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "Les liens dans cette liste recevront les webhooks contenant les recettes pour le plan de menu du jour défini. Actuellement, les webhooks s'executeront à { time }", + "the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "Les liens dans cette liste recevront les webhooks contenant les recettes pour le plan de menu du jour défini. Actuellement, les webhooks s'exécuteront à", "test-webhooks": "Tester les webhooks", "webhook-url": "Lien du webhook" }, @@ -215,7 +225,11 @@ "manage-users": "Utilisateurs", "migrations": "Migrations", "profile": "Profil", - "site-settings": "Paramètres site" + "site-settings": "Paramètres site", + "custom-pages": "Pages personnalisées", + "edit-page": "Modifier la page", + "new-page": "Nouvelle page", + "page-name": "Nom de la page" }, "migration": { "recipe-migration": "Migrer les recettes", diff --git a/frontend/src/pages/SearchPage/FilterSelector.vue b/frontend/src/pages/SearchPage/FilterSelector.vue index c46649e51d2b..72574edb6423 100644 --- a/frontend/src/pages/SearchPage/FilterSelector.vue +++ b/frontend/src/pages/SearchPage/FilterSelector.vue @@ -10,11 +10,11 @@ mandatory > - Include + {{$t('search.include')}} - Exclude + {{$t('search.exclude')}} @@ -28,10 +28,10 @@ mandatory > - And + {{$t('search.and')}} - Or + {{$t('search.or')}} diff --git a/frontend/src/pages/SearchPage/index.vue b/frontend/src/pages/SearchPage/index.vue index 697f21de0238..4ead25d03832 100644 --- a/frontend/src/pages/SearchPage/index.vue +++ b/frontend/src/pages/SearchPage/index.vue @@ -8,7 +8,7 @@ v-model="searchString" outlined color="primary accent-3" - placeholder="Placeholder" + :placeholder="$t('search.search-placeholder')" append-icon="mdi-magnify" > @@ -16,7 +16,7 @@ -

Category Filter

+

{{$t('search.category-filter')}}

-

Tag Filter

+

{{$t('search.tag-filter')}}