我学中文有兩年了. Literally, I [have] studied Chinese, two years already. This conveys the continuity. In having the first 了, indicates the action had been done already and the second part, indicates the duration. The translation for you version is "I HAD studied Chinese for two years" which is different from what you asked.