I know that this is used for junk food, but can you also say “Il dit des cochonneries ?” as in what he's saying is total nonsense? or is there another translation or is it simply not used in with parler or dire...?
About the use of "cochonneries"
In my experience (I'm from Quebec, Canada) :
Il mange des cochonneries
is used to expression someone eating junk food.
Il dit des cochonneries.
is not used to express nonsense, but is used for sexual related stuff. This can also be used with the verbe "faire" to express the action, instead of just talking about it.
So, people might (and probably will) misinterpret you if you use it to describe nonsense. And that could get you to some awkward situations!
What would be a correct expression
As far as I'm thinking I don't really see any expression to tell people that what they say makes no sense but something like
Ça n'a aucun sens ce que tu dis!
Which is very litteral.
Actually, there would be a very "street-y" expression to mean nonsense :
Tu dis de la merde!
On top of Hugo Dozois's answer, I would translate what he's saying is total nonsense as follows:
- Ce qu'il dit est dénué de sens. (this one is really formal)
- Ce qu'il dit n'a aucun sens.
- Ce qu'il dit n'a pas de sens.
- Il dit n'importe quoi.
- Il dit des conneries.
- Il dit de la merde. (this one is worse than the previous one)