"Pray before eating."
Translation:E pule ma mua o ka ʻai.
Because "ma mua o" is a locative phrase (telling "location" in time or space) that means "before." In hānai mua, "mua" is being used as an adverb meaning "first" (do something first, before doing something else).
The sentence could be revised to say something like: E hānai i nā kūpuna MA MUA O ka hānai ʻana i nā keiki. (Feed the elders BEFORE feeding the children.) So then you could say: E hānai MUA i nā kūpuna, a laila, e hānai i nā keiki. (Feed the elders FIRST, then feed the children.)
With the locatives "mua" and "hope," ALWAYS use "ma" instead of "i" when it indicates anything to do with time or chronology, and with the meanings "before" or "after." For example, "Hele ʻo ia i kahakai ma hope o ke kula." (S/he goes to the beach afer school.) You would never say: Hele ʻo ia i kahakai i hope o ke kula.
If you are referring to location, "ma" and "i" can usually be used interchangeably, but then the translations would ordinarily be "in front of" or "behind." For example: Aia ke kaʻa ma hope o ka hale, OR Aia ke kaʻa i hope o ka hale. Both would mean the car is behind the house, but personally I would probably say "ma hope" here; I'm kind of uncomfortable with using "i" here.
Another time you can use "i" with "mua" is when you simply want to use "mua" as an adverb, meaning "forward": E hele kākou i mua! (Let's go forward!) If you use "ma" in this sentence, it will sound like you're not finished with your sentence because you're going to describe something that happens afterwards (chronology).
Does this help or just make it more confusing?