Nationalism and liberty should NEVER construed to be anywhere the same thing. In general, when nationalism rises, liberty falls. Nationalism has risen in Turkey and liberty has fallen. Nationalism has risen in Russia and liberty has fallen. You get the point.
Nationalism has been used FOREVER by autocrats to suppress liberty. It is the go to option and it works nearly 100% of the time.
At least when I was younger, the general recieved-wisdom was 'nationalism good, patriotism bad'. At least on the left. Patriotism was what conservatives in powerful established countries went in for, expressing their belief in their superiority, nationalism was the legitimate desire for the colonised to determine their own future. Indian nationalism, Irish nationalism...generally seen as causes to be supported.
This of course also enrages those of a more conservative disposition, who (not 100% without justification, I'd say) see it as a double-standard. Even now something like Scots nationalism has a very ambiguous status, depending on who is judging it.
I would absolutely agree it's 100% dependent on context, and there are many instances where 'nationalism' has another connotation entirely. There really doesn't seem to be any real agreement on what the distinction between 'nationalism' and 'patriotism' actually means. (I'm also less negative about patriotism than I used to be).
You mention Turkey, but the Ottoman empire fell partly because of Arab nationalism. Nationalism in that case was the enemy of imperialism.
And what happens repeatedly is yesterday's oppressed nationalists struggling for self-determination, become tomorrows' suppressors of their own national minorities in turn.