Yes you learn it. You can check it in any dictionary. One clue if that if you hear the noun with the definite article "an" and the following noun is lenited (H added) then it is feminine.
Bean = woman, An bhean = the woman
I think that "leat" alone should mean "with you"; "maith" means "good". So "Is maith leat é." literally means "It is good with you.". So for "It is with you.", I'd try "Is leat é.", although possibly "Tá leat é." would be better; I don't actually know.
I put "It's good with you" which was not accepted. Isn't that the literal translation?
Person A: "We should go to the park."
Person B: "It's good with me. It's good with you." (pointing to person A) "How about you?" (pointing to person C)
Translation is not about going word-for-word. Different languages say different things different ways. Just because something in one language looks like something in another language on the surface, doesn't mean they mean the same thing.