From 80137c53d66c83b8655e6c1979b990f8f90c810e Mon Sep 17 00:00:00 2001 From: Wayne Goosen Date: Sun, 29 Sep 2024 21:35:40 +0200 Subject: [PATCH 1/2] Add multi-language support Related to #30 --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/WayneGoosen/WayneGoosen.github.io/issues/30?shareId=XXXX-XXXX-XXXX-XXXX). --- src/components/Header.astro | 20 +++++++ ...entials-terraform-github-actions-guide.mdx | 1 + ...ipeline-parameters-variables-terraform.mdx | 1 + ...-docker-compose-to-score-specification.mdx | 1 + ...ployment-guide-part-1-containerization.mdx | 7 ++- ...eployment-guide-part-2-gitHub-workflow.mdx | 3 +- ...it-deployment-guide-part-3-azure-infra.mdx | 3 +- ...oyment-guide-part-4-github-tf-workflow.mdx | 3 +- src/content/config.ts | 3 +- src/data/site.config.ts | 6 +- src/pages/about/index.astro | 56 +++++++++++++------ src/pages/category/[category]/[page].astro | 9 ++- src/pages/index.astro | 10 +++- src/pages/post/[...slug].astro | 10 +++- src/pages/tags/[...tag]/index.astro | 10 +++- src/pages/tags/index.astro | 11 +++- 16 files changed, 125 insertions(+), 29 deletions(-) diff --git a/src/components/Header.astro b/src/components/Header.astro index 32b2c30..adcbb83 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -27,6 +27,19 @@ const SOCIALNETWORKS = [ icon: TwitterIcon } ] + +// Language options +const LANGUAGES = [ + { code: 'en', name: 'English' }, + { code: 'es', name: 'Español' } +] + +function changeLanguage(event) { + const selectedLanguage = event.target.value + const currentPath = window.location.pathname + const newPath = `/${selectedLanguage}${currentPath}` + window.location.href = newPath +} ---
@@ -67,6 +80,13 @@ const SOCIALNETWORKS = [ +