how can I write in mandarin using Writer in 5.0.2.2?

I am learning Mandarin and need to find a way to write in characters by inputting the pinyin on std QWERTY keyboard. Do I need an add-on or download additional languages? And how do I control a switch between normal english entry and pinyin-mandarin when required?
Many thanks