They brought in Eugenio Derbez, a Mexican comedian, to voice Donkey (voiced in English by Eddie Murphy). Donkey in particular speaks in colloquialisms and pop culture references with wordplay, so Derbez wrote a bunch of new lines and jokes that referenced Latin American colloquialisms and pop culture.
Children learn different fairy tales in different countries, so they also managed to change the identity of some of the characters without changing their appearances (and without altering video at all, just audio).
I just have to ask: How do you know this?
EDIT: http://www.imdb.com/name/nm0220240/otherworks: "Jeffrey Katzenberg and Dreamworks allowed [Eugenio Derbez] not only to dub Donkey's voice, but to translate and adapt the script of "Shrek" and "Shrek 2" to make it more appealing to Latin America"
I also remember that the Gingerbread Man was one of the characters who was altered, but I don't remember the name of the Latin American replacement.
What was relocalized was the Muffin Man nursery rhyme (http://en.wikipedia.org/wiki/The_Muffin_Man), which was substituted by Pinpon's ronda song:
Pinpon is a puppet very handsome and made out of cardboard. He washes his little face with soap and water. He untangles his hair with an ivory comb. And in spite of the hair pulling he cries not nor even winces.
I don't watch this type of movies often so I tend to bundle them together into "Pixareque" category in my mind ;).