It's really confusing when to be sure if the letter g is to be pronounced like giraffe or like girl. Both are followed by i. So how can we know the difference? On the other hand, we have gender and general. So is there a rule?
There are two ways to pronounce the letter "g" at the beginning of a syllable.
The hard g /g/
is the most common pronunciation. It comes:
- before a consonant (great)
- before a back vowel (go, garden, get)
- before a front vowel in most words of Germanic origin (girl, gift,...)
- at the end of a word (frog)
The soft g /ʒ/
- It is extremely rare at the beginning of a syllable. The only words I can think of at the moment are
- genre [ʒɒnrə].
- bourgeois [ˈbʊəʒwɑː]
which are both loan words from French that have kept the French sound /ʒ/.
/ʒ/ is a little more common at the end of a word, but there again we only find it in loan words from French (rouge, garage)
/ʒ/ is more frequent in combination with /d/ in /dʒ/
It is the usual pronunciation if "g" is before the letters ‘e’, ‘i’ or ‘y’.
- giraffe [dʒɪ'rɑːf]
- gin [dʒɪn]
This is only a general framework to start with and you will find exceptions of course. When you are not sure you can consult a dictionary, even online dictionary will give the IPA phonetic notation.
I've just found this online article Why are there two pronunciations for the letter 'G'? with a little humoristic touch on the pronunciation of GIF.