Contrafactum

In vocal music, contrafactum (or contrafact, pl. contrafacta) is "the substitution of one text for another without substantial change to the music".
Categories.
Translations meant for singing are not usually intentional "substitution", examples of contrafacta that are wholesale substitution of a different text include the following types:
Poems set to music.
An existing tune already possessing secular or sacred words is given a new poem, which often happens in hymns, and sometimes, more than one new set of words is created over time:
Self-reworking.
A lyricist might re-cast his/her own song (or someone else's song) with new lyrics, as in the case of Alan Jay Lerner with the number "She Wasn't You" / "He Isn't You" from the stage and film versions, respectively, of the musical "On a Clear Day You Can See Forever".
Parody.
Intentional parodies (as opposed to mere translations) of lyrics, especially for satirical purposes, are practiced in the United States by "Weird Al" Yankovic with popular music; the humorist Tom Lehrer with his song "The Elements", which uses a tune from "The Pirates of Penzance"; Forbidden Broadway with musicals; the Capitol Steps; and Mark Russell (the last two involve political parody).
Examples.
Other notable songs with significantly-different lyrics in different languages include the following:
Songs which have been re-written by the same writer with different lyrics include:
Contrafactum has been used in writing several national anthems, such as those of the United States, United Kingdom, Russia and the Netherlands.
Legal issues.
The above examples involve either music that is in the public domain or lyrics that are modified by the original lyricist, but an obvious consideration in producing a contrafactum of someone else's music in modern times is the copyright of the original music or lyrics upon which the contrafactum is based.