This is an endearing term that is used by South Africans in just about every social situation. Seriously, when in doubt, just say “Ag shame” and your sentiment will be greatly appreciated.
A: “I just got a new puppy.”
A: “Her sister is seriously ill and was admitted to hospital.”
A: “My brother won a million bucks yesterday.”