Nationalism (such as it existed) really wasn't tied to language at that point.
Consider Scotland, for instance, where the dominant population of the Lowlands was Scots-speaking and thus linguistically had more in common with the English than with their Gaelic-speaking countrymen to the north, but their sense of nationhood was always tied with the latter group and against the English.
Portugal had traditionally been its own kingdom but Galicia had never been part of it. It was understood to be a territory of the Spanish crown, regardless of its language.