Latin to english translation

The sentence I need help translating into English is:
Ubi nox venit et Polyphemus dormivit, Ulixes et viri ei nocebant

I believe the sentence translates into something similar to:
When the night comes and Polyphemus sleeps, Ulixes will hurt her husband

When night came and P. went to sleep, Ulysses(Odysseus) and his men proceeded to do him harm.
(They stuck a heated pointed stake into his one eye and blinded him. The tale is in Homer’s Odyssey.)

Can you see how you went wrong? You need to learn some Latin before you can get it right. Looking up the words is not enough.

To be even more specific, hoping it helps:
here’s where you should look into: “et viri ei nocebant”

You said “to do him harm.” Wouldn’t this say, “we’re doing him harm?” Because it is imperfect tense. This isn’t a correction, just a question.

Language Guy, you should read more carefully what mwh wrote. The imperfect in the original sentence could probably be labelled (if we want to label things) as an inceptive imperfect (action as begun, AG §471c).