There are some tools that will do it for you. But before you get into it, you might want to research what engine the game is running and how to unpack or de-encrypt it. For example, KAG (kirikiri aka .xp3 files) you have to unpack and decrypt them. You have to manually translate every line of dialog as well.
RPGM has a tool that can translate and create a patch for it.
You also have tools out there that hook into certain games like visual novels and translate on the fly.