part of ChatGPT is it was trained only to predict the next word/token! It wasn't trained on specific tasks means it can do almost anything. That's what a lot of people don't get. So it can translate into any language, write in any code ..