Possible meanings are 1) the heavens and the earth are spoken of as if they have emotions like people. Alternate translation: "Let it be as if the heavens are glad and the earth rejoices" or 2) "the heavens" and "the earth" are metonyms for those who dwell in those places. Alternate translation: "Let those who live in the heavens be glad and let those who live on the earth rejoice" (See: [[rc://en/ta/man/translate/figs-personification]] and [[rc://en/ta/man/translate/figs-metonymy]])
Possible meanings are that the word "them" refers 1) to the heavens and the earth, or 2) to those who dwell on earth. Alternate translation: "let them say to the nations" or 3) to those who are among the nations, that is, the nations. Alternate translation: "let the nations say"