-
Notifications
You must be signed in to change notification settings - Fork 201
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
withAllLocales
doesn't query on all locales.
#2196
Comments
I'm having the same problem: V 10.7.0 (and in latest) |
@votemike I figured out my issue. I had to continue digging down into the nested fields. Our entry.fields.content['en-US'].fields.title['pt-BR'] I hope maybe that helps but not sure if it's the same for you. |
Is that while you are querying the API? |
Yeah, so
|
So what query are you using to query the pt-BR title? |
const query = {
content_type: 'page',
'fields.path': path,
include: 5,
limit: 1,
} This get's our |
Ahh, so you query by path (which I guess is the same in all locale's) and then choose the pt-BR localisation of the title. |
Expected Behavior
Querying with withAllLocales should query on all translations.
E.G.
Should return my results for any localised url.
Actual Behavior
The query mentioned above only works if querying url specified in the default locale language.
Possible Solution
Steps to Reproduce
Set up Contentful with a default language and a language that falls back to the default language.
Create a model with a translatable URL field.
Add an entry with with only a url in the default language
Add an entry with with a url in both languages
Query based on non-default url.
Context
I have several pages that can be in several languages.
Sometimes I want all languages to use the same URL.
Sometimes I want each language to have a unique URL.
I want to retrieve the page by URL.
I cannot pass the locale in to the query, as locales with no URL translation will not fallback to the default language url for querying purposes.
Environment
The text was updated successfully, but these errors were encountered: