@Wanze, thanks for the answer, worked like a charm. Now I've another question.
Here is my languages setup:
default ---> Turkish (Türkçe) / name ---> tr
-------------------------------------------------------------------
other ---> English (İngilizce) / name ---> en
-------------------------------------------------------------------
flags ---> tr.png / tr_off.png / en.png / en_off.png
-------------------------------------------------------------------
In my working code I setup the language names as two letter codes (tr and en), and this is not good for the content editor. However, if I setup the language names as normal (Türkçe and İngilizce, for Turkish and English, respectively) I cannot get the two letter code for images.
My question is how can I get two letter codes to put as flag image's sources when the language names are set as Turkish and English?
Thanks.