Welcome to the forum. The API output token limit for Gemini-1.5-flash is (Modele Gemini | Gemini API | Google AI for Developers) 8192 tokens. Translate that into characters by multiplying by about 3 to 4 and you get the output file size you posted.
To translate a longer text, you would need to first partition it to sizes such that the translated output doesn’t exceed the output token limit. Then you would have to concatenate the partial translations. Since this process requires multiple API calls and (unless you take further steps to add the previously translated parts into the prompt to ensure semantic consistency) potentially worse translation output, consider using a translation API instead of a generative LLM for this task.