How can I add more languages to the website? #214
-
Currently, the website supports both French and English languages. I’m interested in expanding the multilingual capabilities by adding languages such as German and Dutch. Could you please provide guidance on the following: Files and Directories: Which specific files or directories should I modify or add to implement the new languages? Any examples, documentation links, or step-by-step instructions would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @Najib90! You have a few options: Content Collections: You can continue using Content Collections to store localized content for different languages and query them as needed. For example, create or adjust the Hero component by setting up a collection directory called CMS Integration: Another option is to use a CMS to manage your content, which follows similar logic to Astro's native Content Collections. The content will be stored centrally and queried based on the active language. i18n Library for Shared Components: While Content Collections are great for page-specific content, you’ll still want an i18n library for translating strings in components shared across multiple pages (e.g., Layouts or reusable components). I recommend checking out Paraglide-Astro. It integrates smoothly with Astro's native i18n handling for language detection, so you won't need to duplicate logic. Plus, messages are fully typed and treeshaken, ensuring only necessary translations are sent to the client. Useful links: |
Beta Was this translation helpful? Give feedback.
Hey @Najib90! You have a few options:
Content Collections: You can continue using Content Collections to store localized content for different languages and query them as needed. For example, create or adjust the Hero component by setting up a collection directory called
hero
. Then, add JSON files for each language, such asheroEN.json
,heroFR.json
, and for the new languages,heroDE.json
andheroNL.json
.CMS Integration: Another option is to use a CMS to manage your content, which follows similar logic to Astro's native Content Collections. The content will be stored centrally and queried based on the active language.
i18n Library for Shared Components: While Content Collections are great…