In this chapter, I venture a bit into the spoken Croatian, but such features are a part of the Standard too. There's a feature normally called ethical dative, but it has nothing to do with ethics. Actually, the name comes from Latin, and the feature there is really not the same as in Croatian, just a similar one.
Recall impersonal constructs with je describing situation, similar to English constructs:
Hladno je. "It's cold." (the whole sentence is in neuter in both languages!)
Kasno je. "It's late."
Now if we want to say who is experiencing this, English put the person in place of the subject:
"He's cold."
"He's late." (but look below)
Croatian takes a different road. First, it seems that it can be cold to everyone or cold to someone, in the same way that a letter can be to someone, and in all those cases Croatian uses the dative, to note who "gets" it:
Hladno mu je. lit. "It's cold to him." = "he's cold." (but not his body, he just feels the cold!
Kasno mu je. lit. "It's late to him." = "He feels it's late."
Other people maybe think it's not late: it happens to him. This notion "things happen to someone" is then extended all over the place:
Ti si prijatelj. "You're a friend." (a general statement)
Ti si prijatelj Ani. "You're a friend to Ana." (a statement about what goes on with Ana) = "you're Ana's friend."
Škola je počela. "(The) school has started."
Škola mi je počela. "(The) school, I have something to do with, has started." = "My school has started."
Sestra mi se vratila. "My sister came back."
Juha mu je hladna. "(the) soup is cold for him." (but someone else would maybe think it's ok)
Dijete mi se razboljëlo. "My child got sick."
Hlače su joj preuske. "(The) trousers are too tight for her." (but may be ok for someone else)
Don't ever think that dijete mi always implies "my child": it just means that the whole action happened "to me", it happened in "my" house, "my" family, "my" life, and "my" child is just a consequence. Since people talk about things that matter, and since mi "to me" is shorter than the possesive moj "my", people use dative like this a lot! It's similar to colloquial English "The school started on me."
Some more examples:
Vlak joj je kasnio. "her train was late."
Ivanu se brat zaposlio. "Ivan's brother got employed."
Sometimes, it can have ambigous meanings:
Žena mi je pripremila ručak.
Does it mean "(The) woman prepared (a) lunch for me" or "My wife prepared (a) lunch."?
It depends on the context. Žena can be someone unrelated to you (meaning both "woman" and "wife") - but it's sure that you have something to do with the whole thing! Likely, you will eat...
More ambigous sentences:
Djëca su mi razbila prozor.
It could mean:
"My children broke (a) window."
"Children broke my window."
"My children broke my window."
Furthermore:
Knjiga je zanimljiva. "(The) book is interesting."
Knjiga mu je zanimljiva. "He considers (the) book interesting." (the usual meaning) or "(The) book he wrote is interesting." (seldom)
Sometimes, usually in the spoken Croatian, one can add the dative ti or vam, trying to say that what is said should matter to the listener, it's just asking for attention, or trying to produce compassion (hence the 'ethical' in the name of a similar use of the dative in Latin):
Ja säm ti umorän. "You know, I'm tired." (only a rough translation!)
Is this all "gramatically correct"? English has a similar feature: "on me", "on him", that's considered non-standard. Well, I'll just cite an article:
The Dativus Ethicus (henceforth DE) is a grammatical construction with an ancient lineage. Strict grammarians point out that it is colloquial and from the point of view of the written language always appears as a structurally superfluous element (Hofmann & Szantyr, 93). Nevertheless they cite examples from Sophocles (o: teknon, e: veve:ken e:min o ksenos), Cicero (Hic tibi rostra Cato advolat) the New Testament (Schwyzer, 149).
(Veronica DuFeu: The Dativus Ethicus (DE) in the Slavonic Languages)
One last remark: Spanish and some other languages have exactly the same construct (only the word no is moved left in the Spanish example):
El computador no me funciona. (Spanish) = Računalo mi ne radi. (Croatian)
"It happens to me, the computer is not working."