Fun fact, that inscription also contains of the few continuity errors in published Tolkien material. It starts with:
> The Doors of Durin, Lord of Moria
but as the Tolkien Gateway explains:
> The name Moria means "Black Chasm" and was a derogatory description of the place which the Dwarves did not like, and was given after Durin's Bane took over the city in the Third Age. It is therefore a mystery why that name appears on an inscription made in the Second Age, and made in consent with the Dwarves.
The most common "mitigating explanation" I see is that Tolkien, the "translator," perhaps used the name the reader would be most familiar with (Moria) instead of the city's real name (Khazad-dûm) when transcribing the door's inscription.