-
-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internationalization #18
Comments
Hello @wiledusc, The Internalization (i18n) is something pending. We had given it a low priority assuming that few people could need it, but no. Since you published the issue I've been thinking about it, but to give you a detailed and generic solution we need time to develop and test it. For now, if you give some details we can talk about a solution that suits your needs. For this, the following doubts come to me mind:
|
How are you translating the pages that are not Posts? Do you plan to add languages over time or have you defined the limit number of languages you want to translate into? Are the posts still loaded from src/data/posts folder or are loaded from an API? |
Hi @wiledusc Here some changes that could work to make your blog multilingual (en, pt). These are ideas that I propose to you assuming that you do not use astro-i18next, you do not need many page translations and you are focused on the posts. On these days I will make some updates to the template so that it becomes part of the AstroWind core. Assuming you want the urls like this:
Project structureFrom:
To: │ ├── data/
| | └── posts/
+ | ├── en/
| | | ├── english-post-slug-1.md
| | | └── ...
+ | └── pt/
| | ├── portuguese-post-slug-1.md
| | └── ...
│ ├── pages/
+ | ├── [lang]/
│ | | └── [blog]/
| | | ├── [...page].astro
| | | └── [slug].astro Note: The new folders in Frontmatter code inside PostsFrom:
To: ---
pubDate: "Aug 08 2022"
title: "AstroWind template in depth"
description: "Ornare cum cursus laoreet sagittis nunc fusce posuere per euismod dis vehicula a, semper fames lacus"
...
+lang: en
+alternate:
+ - hreflang: pr
+ href: portuguese-post-slug-1 Note: Do not include the "+" sign Changes in
|
Thanks, It worked! |
Hey guys,
I'm creating a blog with this template and I would like to know how to add the same posts in different languages.
The text was updated successfully, but these errors were encountered: