Replies: 6 comments 5 replies
-
To understand, you want to follow the page's language or the UX language? |
Beta Was this translation helpful? Give feedback.
-
I want to follow the page language |
Beta Was this translation helpful? Give feedback.
-
Is the page with the PnP Modern Search Results web part also translated? I have looked at it and it seems like only translated pages have a value in {Page._SPTranslationLanguage} |
Beta Was this translation helpful? Give feedback.
-
If you wonder how to see that the token wasn't available I have uploaded a video about it to YT, https://youtu.be/zZN_zMAosaY |
Beta Was this translation helpful? Give feedback.
-
Thanks for your message Kasper |
Beta Was this translation helpful? Give feedback.
-
I assume you followed my post at https://www.techmikael.com/2020/09/search-and-modern-multilingual-pages-in.html and I'll recheck the query variable as that post is now getting old 🙂 |
Beta Was this translation helpful? Give feedback.
-
Follow the template below or we will have to delete this request!!
We can assist a lot faster if you provide the following information:
Version used
4.9.3
Describe the bug
I am trying to filter pages / news based on current page language.
OOB news webparts are working as per page language.
Pnp modern search webpart is not working as the OOB webpart.
When I am in DE page, i get all results in DE but modern search webpart is respecting my browser language and giving the results.
When I am in EN page, i get all results still in DE because above mentioned reason.
I have the following query but this respects the SharePoint display language.
(SPTranslationLanguage:{CurrentDisplayLanguage} OR (NOT SPTranslatedLanguages:{CurrentDisplayLanguage} AND NOT SPIsTranslation:true))
then I changed the query with this ending:
{?{SPTranslationLanguage:{Page._SPTranslationLanguage} OR (NOT SPTranslatedLanguages:{Page._SPTranslationLanguage} AND NOT SPIsTranslation:true)} NOT} (SPTranslationLanguage:{Site.Locale} OR (NOT SPTranslatedLanguages:{Site.Locale}
AND NOT SPIsTranslation:true))
I tried to use {PageContext.currentUICultureName} but this always leads to null after query resolving.
To Reproduce
Create a page with langugae variant. (one in DE and variant in EN)
Apply above query, we would need to get DE content when we are in DE page.
We would need to get EN content when we are in EN page if translation page available otherwise DE content should be displayed.
Beta Was this translation helpful? Give feedback.
All reactions