We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a8c7b9 commit b4266aeCopy full SHA for b4266ae
1 file changed
src/pages/[lang]/[...slug].astro
@@ -98,6 +98,29 @@ export async function getStaticPaths() {
98
}
99
});
100
101
+ // Fallback: Create paths for non-English languages using English pages content
102
+ for (const lang of Object.keys(languages)) {
103
+ if (lang === 'en') continue;
104
+
105
+ const englishContentPages = contentPages.filter((p) => p.id.startsWith('en/'));
106
107
+ englishContentPages.forEach((page) => {
108
+ const [, ...slugParts] = page.id.split('/');
109
+ const fullSlug = slugParts.join('/');
110
111
+ const langSpecificExists = paths.some(
112
+ (p) => p.params.lang === lang && p.params.slug === fullSlug
113
+ );
114
115
+ if (!langSpecificExists) {
116
+ paths.push({
117
+ params: { lang, slug: fullSlug },
118
+ props: { page },
119
+ });
120
+ }
121
122
123
124
return paths;
125
126
0 commit comments