GPT-4 excels as a translator, but it often encounters issues with content warnings and formatting errors when translating entire subtitle files via ChatGPT. The solution is straightforward: divide the subtitle file into sections, focusing solely on translating the text and disregarding the timestamps. While it's feasible to have ChatGPT maintain the correct format, I've observed a decline in translation quality when attempting this in a single pass. My preferred approach is a two-phase method: first, translate the text, and then, if necessary, request ChatGPT to adjust the formatting.
To streamline this process, I developed a simple web application. Alternatively, one could manually refine the translations. The prompt is also customizable, allowing for more specific instructions. For instance, you can specify that certain words should be translated according to a provided dictionary.
Considering the cost of translation (approximately $1 for the GPT-4 model per movie), each user utilizes their own API token. The app makes requests directly to OpenAI, ensuring it's safe to share your token. This approach allows users to manage their expenses while benefiting from the advanced translation capabilities of GPT-4.
Source code is at https://github.com/afiodorov/subsgpt