I'm so sorry you experienced something like that.
Of course, there are always bad apples around but usually, this community is really helpful and friendly and I hope that didn't ruin things for you.
I can really empathize with how you felt because I'm Thai and speaking English wasn't my strongest skill for much of my youth and of course, there were always people who mocked me and how I spoke. There were also people who mocked me when I spoke Thai and called me racial slurs, or asked me to say terrible things in my language.
The only thing we can do with these people online is to report and block them and not entertain them because racists only want a reaction out of you and we shouldn't dare grace them with one.
Everyone here has already answered you, but I'd like to add a bit more:
On the forums, we only speak English. This is simply to help staff with moderation.
In the game, you can speak any language.
You are free to speak any language with friends in DMs, whisper or group/party, though!