Replies: 9 comments 16 replies
-
For point 3, see also #789 |
Beta Was this translation helpful? Give feedback.
-
Amazing work so far! ✨ Let me chip in with another idea. I would love to have an i18n API that supports the below set-up:
> getAlternateUrl('about.astro', 'en')
'/about'
> getAlternateUrl('about.astro', 'es')
'/es/sobre-nosotros' This would keep the page structure super clear. It helps with file discoverability and allows multiple contributors to maintain a project without needing to understand all languages. A first step toward this is not assuming that the slug is equal to the filename–which is something that would be nice to have in general. Having such an API also enables automatically including alternate links with proper |
Beta Was this translation helpful? Give feedback.
-
+1 for 404 and 500 page translation. It is a basic feature if you consider user workflow, if you are navigating in a specific language, but go to a page not found you will be sent to the default language. |
Beta Was this translation helpful? Give feedback.
-
It's moving along: https://astro.build/blog/astro-420/#new-redirecttodefaultlocale-config-option |
Beta Was this translation helpful? Give feedback.
-
Hello, I think we often have the situation where we want all locales for a certain page in a single
|
Beta Was this translation helpful? Give feedback.
-
Another thing I recently ran into, I found no good way to build a language switcher which doesn't route the user back to home. So basically I want to change the locale in the current pathname. I think if there was a |
Beta Was this translation helpful? Give feedback.
-
can you add a simple snippet of how you're doing this ? i'm localizing my site, but i'd prefer to not duplicate each page in every language, since a structure change would require replicating the change in every folder 🥲 |
Beta Was this translation helpful? Give feedback.
-
Hi, just to keep track of other dicussions: my main request for i18n is to have full-control over the redirections at request-time, while keeping the page static. This would be currently solved using an edge middleware, in the Vercel sense of the term, so not an Astro middleware as currently documented that runs only for dynamically rendered pages at request-time but only at build-time for static pages. I would need a middleware that runs also for static pages. I'd be eager to see something more built-in in this area. |
Beta Was this translation helpful? Give feedback.
-
I think it is also missing a way to translate the Right now if the website uses a single locale, we can translate the footnote labels like this: export default defineConfig({
i18n: {
defaultLocale: 'fr',
},
markdown: {
remarkRehype: {
footnoteLabel: 'Notes de bas de page',
},
},
}); But how to handle the translation when the website is multilingual? export default defineConfig({
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
},
markdown: {
remarkRehype: {
footnoteLabel: "???",
},
},
}); A possible solution:
Right now, it seems the only way to translate the footnote labels depending on the current locale is to use placeholders in the configuration file and a rehype plugin. In that plugin we need to parse the path from |
Beta Was this translation helpful? Give feedback.
-
Body
Summary
New enhacements to the i18n routing
Background & Motivation
The current i18n routing misses a few features that users needs and find real use cases. Some other features were pushed back from the original proposal due to time constraints.
Goals
/
to/<defaultLocale>
whenprefixDefaultLocale: true
is setBeta Was this translation helpful? Give feedback.
All reactions