Babies won't understand but they will remember n mimic whatever you said. Babies are found to have an excellent memory. At times we do swear but after that, we tend to be more mindful in case it becomes a habit to swear with or without babies' presence. So my husband and I promised not to swear in front of the little ones as much as we can.