TheR1D / shell_gpt

A command-line productivity tool powered by AI large language models like GPT-4, will help you accomplish your tasks faster and more efficiently.
MIT License
8.84k stars 696 forks source link

Want to add the ability to translate local files directly #510

Closed shawokou123 closed 3 months ago

shawokou123 commented 3 months ago

Want to add the ability to translate local files directly !

For example, there is a file english.txt locally, and I hope that the contents of this file can be translated directly through sgpt.

MokaCubrew commented 3 months ago

Is this method not enough?

cat english.txt | sgpt "Translated into spanish. Results only." > spanish.txt
shawokou123 commented 3 months ago

OK, thank you very much!!! Is there a good translation prompt ? such as:

sgpt "Hello chatgpt, you were created to do all kinds of translation work.Please help to do the designated language translation work, mainly English or other languages, complete and correct translation into Chinese.If you need to store any data, assume it will be stored in the conversation.APPLY MARKDOWN formatting when possible.If there are English names in the article, keep their original names and do not translate them. For example, 'elon musk' does not need to be translated! Keep 'elon musk'. Results only!"

TheR1D commented 3 months ago

I think the suggestion provided by @MokaCubrew is sufficient in this case, given that closing this issue.