I am currently in the old city of Dubrovnik, which might be better known to students of European history as Ragusa. Public monuments and documents are in an Italian dialect up until the time of the city being part of Austria. But to what extent was the city writing and speaking in Italian or Serbian/Croatian in the time of the Republic of Ragusa? Was there a change and when/why?
I don't know that there's any clear information on when it changed, but the Republic of Ragusa was certainly Croatian majority in population by the start of the 15th century. Latin was official until 1472 at which point it became the Romantic Dalmatian language, which remained until the fall of the Republic - Slavic languages were banned in the grand council.
It is worth noting that almost all of the aristocracy in the Republic of Ragusa as far back as its independence from Venice in 1358 to the end of the Republic in 1814 (when the grand council met for the last time) had Dalmatian family and Christian names.
Source: R Anthony Lodge - Language contact and minority languages on the littorals of Europe
Latin, Dalmatian and Venetian were languages of state, law and trade. Croatian was language of common people. Nobility was bilingual (or multilingual).
In comparison, the language of Croatian parliament (in Zagreb) was also Latin until 1847.