From 38eff3078356cf4d77e86b6995e42fa81e8722d1 Mon Sep 17 00:00:00 2001
From: Florian Dupret <34862846+sephrat@users.noreply.github.com>
Date: Tue, 13 Apr 2021 18:45:39 +0200
Subject: [PATCH] Localize custom pages and search page
---
.../Admin/General/CreatePageDialog.vue | 2 +-
.../Admin/General/CustomPageCreator.vue | 18 +++++++--------
.../FormHelpers/CategoryTagSelector.vue | 2 +-
frontend/src/locales/messages/en.json | 16 ++++++++++++--
frontend/src/locales/messages/fr.json | 22 +++++++++++++++----
.../src/pages/SearchPage/FilterSelector.vue | 8 +++----
frontend/src/pages/SearchPage/index.vue | 8 +++----
7 files changed, 51 insertions(+), 25 deletions(-)
diff --git a/frontend/src/components/Admin/General/CreatePageDialog.vue b/frontend/src/components/Admin/General/CreatePageDialog.vue
index 6094f1fe7..2754e58d0 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 4abdffe1f..c31f0a017 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 3bd654f27..1fcacaaea 100644
--- a/frontend/src/locales/messages/en.json
+++ b/frontend/src/locales/messages/en.json
@@ -145,7 +145,15 @@
"delete-confirmation": "Are you sure you want to delete this recipe?"
},
"search": {
- "search-mealie": "Search Mealie"
+ "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"
},
"settings": {
"general-settings": "General Settings",
@@ -215,7 +223,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 a92e4d9af..dd0ad136f 100644
--- a/frontend/src/locales/messages/fr.json
+++ b/frontend/src/locales/messages/fr.json
@@ -46,7 +46,9 @@
"token": "Jeton",
"field-required": "Champ obligatoire",
"apply": "Appliquer",
- "current-parenthesis": "(Actuel)"
+ "current-parenthesis": "(Actuel)",
+ "groups": "Groupes",
+ "users": "Utilisateurs"
},
"page": {
"home-page": "Accueil",
@@ -143,7 +145,15 @@
"delete-confirmation": "Êtes-vous sûr(e) de vouloir supprimer cette recette ?"
},
"search": {
- "search-mealie": "Rechercher dans Mealie"
+ "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"
},
"settings": {
"general-settings": "Paramètres généraux",
@@ -185,7 +195,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"
},
@@ -213,7 +223,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 c46649e51..72574edb6 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 697f21de0..4ead25d03 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')}}