Content Relationship and Multi-languages: Wrong type for custom types
See original GitHub issueSetup:
- “prismic-javascript”: “^1.1.5”,
- Two custom types (
home_page
andtip
).tip
is used in a slice ofhome_page
- Master language is
de-ch
and a 2nd languagefr-ch
If I query the master language the custom types in slice.items
is correct ("type": "tip",
)
JS:
const client = await Prismic.api(`https://${repositoryName}.prismic.io/api/v2`, { accessToken })
const response = await client.query("", {lang: "de-ch"})
Result
{
"id": "XKXobhAAAJmVNCNu",
"type": "home_page",
"lang": "de-ch",
"data": {
...
"body": [
{
"slice_type": "content",
"items": [
{
"tip": {
"id": "XKbxCxMAACIAP_bb",
"type": "tip",
"lang": "de-ch"
}
}
]
}
]
}
}
But when I query a non-master language I get "type": "home_page",
as type for the custom type
JS:
const client = await Prismic.api(`https://${repositoryName}.prismic.io/api/v2`, { accessToken })
const response = await client.query("", {lang: "fr-ch"})
Result
{
"id": "XKXzwxAAAByKNFXn",
"type": "home_page",
"lang": "fr-ch",
"data": {
...
"body": [
{
"slice_type": "content",
"slice_label": null,
"items": [
{
"tip": {
"type": "home_page",
"lang": "fr-ch",
}
}
]}
]
}
},
Any idea why?
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Issue with WPML and Pods Templates since 2.8 | WordPress.org
-I'm using WPML to create a multi-language website. -I create two different Custom Post Types with Pods 2.8.1. -I create a bidirectional relationship...
Read more >Best Practices and Considerations for Multilingual Sites
Keep these practices and considerations in mind when you're setting up a multilingual site.Required Editions Available in: Experience Builder sites access.
Read more >How can I rewrite custom post types slugs based on language?
Important: Flushing the rewrite rules is an expensive operation, there are tutorials and examples that suggest executing it on the 'init' hook. This...
Read more >Support different languages and cultures - Android Developers
Some users choose a language that uses right-to-left (RTL) scripts, such as Arabic or Hebrew, for their UI locale. Other users view or...
Read more >Multilanguage text - Adobe Support
Use this guide to understand how to work with Multilanguage text in Animate.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The issue was identified and it’s related to the translation from one locale to another. We already released a fix to prevent that from happening again and another fix will be released on Monday for already corrupted links. Sorry for the inconvenience.
Le ven. 5 avr. 2019 à 18:07, Marcel Eyer notifications@github.com a écrit :
The fix is coming today to resolve this issue. I’ll keepyou posted 😉
Le lun. 8 avr. 2019 à 11:46, Marcel Eyer notifications@github.com a écrit :