Over time, both dogs learned to recognize and obey commands in both languages.
dogs don't have language the way we do, but can in fact learn multiple words for the same command, which means that they are, in a limited sense, responding to multiple languages.
dogs don't actually understand any human languages.