Score:0

How to find all nodes that have no translation for specific language?

in flag

I am looking for a programmatic way to find all nodes of language en that have no translation for language XY. Is there even a way to do that without raw sql? I tried using entityQuery but I cant get the negative condition get to work...

4uk4 avatar
cn flag
It's hard to query something which doesn't exists. I would array_diff() two queries.
Alex avatar
in flag
@4uk4 i just got the same idea - thanks :)
ru flag
Entity query can't do this, but SQL / DBquery can do it, either with a sub query `...where id not in (...subquery)...` or by outer-joining the node table on itself (then you can filter on the joined nid being null). But I wouldn't go the SQL route unless you are querying _really huge_ numbers of nodes.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.