My Question is in regards to Surah Yusuf ayat 31 of the Holy Quran. In the later part where Allah (SWT) says "and when they saw him, they greatly admired him and cut their hands and said, " Perfect is Allah! This is not a man; this is none but a noble angel"". My Question is did the women literally say perfect is Allah? As far as I am aware Allah SWT’s name was not known by people back then and the women were polytheists so they may have praised their own deities ( though I may be wrong). I would appreciate if you can explain this.

Many nations believed in one God but that he has sent these idols or that the idols have to worshipped instead.