Hi! I am having a hard time configuring my multilingual webstore. I followed the latest example, but when going to /en-us/document I am getting a 404 message.
When making a query, I do get returned null btw.. I have some of my examples below. I did setup a fast language switcher, but I assume I should be able to get the pages as well when just typing the locale in my webbrowser
query MyQuery {
prismicPage(lang: {eq: "en-us"}) {
lang
alternate_languages {
id
type
lang
}
data {
gatsby_slug
}
url
}
}
en-us is not my main locale, is this the reason why I got returned null?
gatsby-node:
result.data.contentPages.edges.forEach(({ node }) => {
console.log("starting content pages", node.uid)
console.log(node)
createPage({
path: node.url,
component: path.resolve(`./src/templates/Page/index.jsx`),
context: {
id: node.id,
uid: node.uid,
lang: node.lang,
},
})
})
Page Template:
export const query = graphql`
query PageQuery($id: String, $lang: String) {
prismicPage(id: { eq: $id }, lang: { eq: $lang }) {
url
uid
type
id
lang
alternate_languages {
id
type
uid
lang
}
data {
pagecontenthero {
gatsbyImageData(placeholder: BLURRED, layout: FULL_WIDTH)
alt
}
type_of_page
gatsby_slug
meta_description {
text
}
meta_title {
text
}
title {
text
}
introduction {
text
}
body {
... on PrismicSliceType {
slice_type
}
...PrismicPageBodyPageContentFragment
...PrismicPageBodyPageFaqFragment
...PrismicPageBodySingleImageFragment
...PrismicPageBodyAlternateGridFragment
}
}
}
}
`