I'm confused about names of meals. I translated "middagen" as "lunch," since it's in the middle of the day. "Dinner" to me means the main meal, but that's usually only in the middle of the day on a Sunday (and then the later meal is called "supper.") This is all about customs and not really about language.
TL;DR "Middag" means evening meal ("dinner") in Swedish.
I know it's confusing, but that's the way it is. Historically, it used to mean "lunch", but the meaning shifted to mean "main meal of the day" and when the main meal shifted to dinner, the word followed. In the course, we use "dinner" to mean the evening meal of the day.