From 46a53c075427e3c01b168c0114185d698a9e6c5b Mon Sep 17 00:00:00 2001 From: Simon C Date: Wed, 17 May 2023 16:13:58 +0200 Subject: [PATCH] feat: Add multilanguage --- README.md | 2 +- config.yml | 18 +++++++++++++++++- i18n/en.yml | 16 ++++++++++++++-- i18n/fr.yml | 14 +++++++++++--- layouts/index.html | 8 ++++---- layouts/partials/footer.html | 2 +- layouts/partials/header.html | 15 +++++++++------ 7 files changed, 57 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 329790d..952fc1a 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Le logiciel est en version alpha et donc ne fonctionne pas actuellement. Le but - [ ] Pouvoir ajouter/supprimer/déplacer un dessin - [ ] Pouvoir télécharger le fichier - [ ] Rendre le site léger coté Javascript (minification, suppression du code non utilisé) -- [ ] Rendre le site multi-langue +- [x] Rendre le site multi-langue - [x] Afficher le fichier PDF dans une _modal_ - [x] Rendre le site léger coté CSS (minification, suppression du code non utilisé) - [x] Ajout une interface pour sélectionner un fichier diff --git a/config.yml b/config.yml index e76d7d8..9cdf412 100644 --- a/config.yml +++ b/config.yml @@ -1,5 +1,21 @@ baseURL: http://example.org/ -defaultContentLanguage: fr +defaultContentLanguage: en +defaultContentLanguageInSubdir: true + +params: + brand: PDF-Editor + +languages: + en: + languageName: English + weight: 10 + # params: + # icon: + fr: + languageName: Français + weight: 20 + # params: + # icon: build: writeStats: true diff --git a/i18n/en.yml b/i18n/en.yml index 8df8793..1408727 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -1,2 +1,14 @@ -title: "PDF file editor" -description: "Logiciel WEB libre permettant de modifier un fichier PDF" +title: + other: PDF file editor +description: + other: Free WEB software allowing to modify a PDF file, reorder the pages and modify its metadata. +selectText: + other: "Choose PDF File :" +privacyInfo: + other: No file is sent to the server, data is processed locally in your browser. +footerText: + other: Made with ❤️ by Weko and hosted by RésiLien 🐱 +buttonDownload: + other: Download +buttonClose: + other: Close diff --git a/i18n/fr.yml b/i18n/fr.yml index 39c1af1..96eb6b4 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -1,6 +1,14 @@ title: other: Editeur de fichier PDF description: - other: "Logiciel WEB libre permettant de modifier un fichier PDF, réordonner les pages et modifier ses métadonnées." -button: - other: "Choisir un fichier" \ No newline at end of file + other: Logiciel WEB libre permettant de modifier un fichier PDF, réordonner les pages et modifier ses métadonnées. +selectText: + other: "Choisir un fichier PDF :" +privacyInfo: + other: Aucun fichier n'est envoyé au serveur, les données sont traités localement dans votre navigateur. +footerText: + other: Réalisé avec ❤️ par Weko et hébergé par RésiLien 🐱 +buttonDownload: + other: Télécharger +buttonClose: + other: Fermer diff --git a/layouts/index.html b/layouts/index.html index 8267baa..e07da9b 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -3,7 +3,7 @@

{{ i18n "title" }}

{{ i18n "description" | safeHTML }}

- Sélectionne un PDF : + {{ i18n "selectText" }}

@@ -13,7 +13,7 @@

- Aucun fichier n'est envoyé au serveur, les données sont traités localement dans votre navigateur. + {{ i18n "privacyInfo" }}

@@ -60,13 +60,13 @@ - Télécharger + {{ i18n "buttonDownload" }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index de771eb..5d25eda 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,5 +1,5 @@ diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 99acd6c..ae9773f 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,12 +1,15 @@
-

PDF-Editor

- {{/* +

{{ .Site.Params.brand }}

+ {{ if .Site.IsMultiLingual }} + {{ $currentLanguage := .Language }}

- */}} + {{ end }}