In modern SharePoint, we have translated a SharePoint home.aspx page into many languages and want only news articles in a specific language to show on the respective translation of that page.

Unfortunately, the default (English) page does not have the SPTranslationLanguage property, but instead is identified with SPIsTranslation:true/false. The translated pages don't have the SPIsTranslation field, and the default page does not have the SPTranslationLanguage.

I built a query that goes like this:

(SPTranslationLanguage:{Page._SPTranslationLanguage} OR (NOT SPTranslationLanguage:{Page._SPTranslationLanguage} AND NOT SPIsTranslation:true))

But this doesn't work because as soon as the query finds a page where one of the two fields doesn't exist (which is any page since it EITHER has SPTranslationLanguage OR SPIsTranslation but never both), the query fails.

Is there a workaround for this? We need to use the KQL method because we're also working with filters based on user profile data and more, so the normal news web parts aren't nearly enough.

  • From the question it's not clear what you're trying to achieve. Please edit, and supply sample input and expected output, and ping here by adding a comment once done.
    – Slavik N
    Feb 17 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.