Laura Neto
08/15/2023, 8:48 AM/umbraco/delivery/api/v1/content/item/{path}
endpoint passing in whatever relative url I receive from the browser.
I have two cultures, en-US at /
and pt-PT at /pt
.
If I pass in /pt
as the path, I do get the content in portuguese, but I don't see an easy way to know which culture I'm receiving... Unless I look at the cultures
dictionary and see which culture path matches the route.path
, but that feels a bit meh 😅
As for the use case, I was basically trying to build a language switcher and wanted to know the current culture. (also thinking that in the future I might want to grab translations based on the culture)
Anything I am missing? Thanks! 🙂ProNotion
08/25/2023, 12:20 PMSebastiaan
08/25/2023, 12:45 PMAllow vary by culture
. But since you don't have 1:1 translations (I assume) you won't get that.
You will indeed have to rely on the path I think.Sebastiaan
08/25/2023, 12:46 PMSebastiaan
08/25/2023, 12:50 PMfeatured
will show up in the items
result. So it's basically adding a field to the examine index: https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/extension-api-for-querying#custom-selectorSebastiaan
08/25/2023, 12:51 PMculture
field and set it based on what language the parent (or the first ascendant) has set on the Cultures and hostnames
config.Sebastiaan
08/25/2023, 12:52 PMProNotion
08/25/2023, 12:52 PMSebastiaan
08/25/2023, 12:53 PMProNotion
08/25/2023, 12:53 PMSebastiaan
08/25/2023, 12:53 PMSebastiaan
08/25/2023, 12:54 PMProNotion
08/25/2023, 12:55 PMSebastiaan
08/25/2023, 12:55 PMProNotion
08/25/2023, 12:56 PMSebastiaan
08/25/2023, 12:57 PMProNotion
08/29/2023, 10:27 AMLaura Neto
08/29/2023, 12:49 PMLaura Neto
08/29/2023, 12:50 PMSebastiaan
08/29/2023, 2:11 PMLaura Neto
08/30/2023, 12:11 PM