Application to install and create translations for NieR Replicant™ ver.1.22474487139...
Versão em português desse README.md aqui
Translation project for PT-BR of the fabulous Nier Replicant ver.1.22474487139, using ChatGPT as support for translation. The project aims to include more people in this gaming masterpiece. As an RPG with various dialogues, not having Brazilian Portuguese as an option tends to push many people away.
The translation was based on English texts, with the support of some Spanish texts to assemble Portuguese text. Once again, an approach using ChatGPT was employed to translate most texts. What was done was review to ensure that what ChatGPT returned was accurate (and guess what, most texts were indeed accurate).
ChatGPT is a tremendous innovation, greatly aiding in translating the entire game in such a short time. Something that using services like Google Translate or Bing cannot achieve as quickly, given that translations TO THIS DAY still raise doubts and are often incorrect.
ChatGPT isn't perfect, but at its current level, it allowed the construction of this application and sharing it with all of you.
It's possible to use this project to translate into other languages; just change the parameters, and ChatGPT will do the work for you—just remember to review the texts. 🎉
This project has no intention of replacing other translation projects that are being undertaken. I believe they do a good job; however, doing this manually takes much longer (but as a result, tends to be more careful).
If you'd like to buy me a ☕, here's my PIX key for support: 0dd32e9d-8b78-4978-ad8a-797cbd7380d1
You can review the localized texts in texts/translation (where the translation is stored). Make your edits/improvements and submit a pull request, clearly explaining why you made those changes — they will be reviewed and approved accordingly.
All texts have been carefully reviewed by me, Caroline Urbano, and Cristian Kirsch. However, there might be something that slipped through the cracks here and there, so if something like that happens, please inform us.
If you’d like to discuss this further, feel free to reach out on my Discord server or through my social media channels below:
I want to thank the people who dedicated themselves to making this project the best possible for true fans.
Caroline Urbano, who works as a translator, took the first steps in the review, evolved a lot with the project, and I imagine she did too. Her social media profiles are listed below.
Cristian Kirsch, a super nice guy, a huge NieR franchise fan, showed an unprecedented dedication to the review. All of this is a result of his effort, and I am very grateful. His social media profiles are listed below.
Here, I'll describe two ways to install the translation, using the installer and another manually in case there's an issue with the installation.
It's worth noting that this installation method will automatically install SpecialK to your game.
-
Download the application executable here: Release
-
Extract the zipped
.zipfile to a preferred folder. -
Run the
instalar e atualizar.batfile. -
The program will execute and prompt for the directory path to NieR Replicant ver.1.22474487139.
Example of path
C:\SteamLibrary\steamapps\common\NieR Replicant ver.1.22474487139 -
That's it, just wait for the completion and start the game already translated. 🎉
-
Download the necessary files here: data
-
Extract the zipped
.zipfile to a preferred folder. -
Open the directory where your NieR Replicant is installed.
Example of path
C:\SteamLibrary\steamapps\common\NieR Replicant ver.1.22474487139 -
Open the
datafolder. -
The zipped file you downloaded contains two files -
common.arcandinfo.arc. Place both inside thedatafolder.It will obviously replace the original files, if possible, make a backup of them.
-
That's it, now just start the game. 🎉
This step is not mandatory; only do it if you want the textures to be translated as well.
-
Download the necessary textures here: textures
-
Download SpecialK here: SpecialK
-
Place the
dxgi.dllfile inside the root folder of your NieR: Replicant. -
Create the directory
SK_Res\inject\textureswithin the root folder. -
Within the created directory, unzip all the
.ddsfiles you downloaded in step 1. (the textures folder must contain these.ddsfiles) -
That's it! Now you can start the game. 🎉
-
Install
nier-translator.exe manager install --specialk
The
--specialkargument causes SpecialK to be installed locally. The--updateargument checks if local files are up-to-date; otherwise, a download from the remote repository will be performed. -
Uninstall
nier-translator.exe manager uninstall --specialk
The
--specialkargument causes SpecialK to be uninstalled locally.
This project was made possible thanks to these two repositories:
- Tool for asset extraction - kaine
- Tool for text extraction - NieR-Text-Tool
- Tool for texture extraction and injection - SpecialK
If you want the project for development, some prerequisites are necessary.
- Python
- You can download it here: Python
- Here's a step-by-step tutorial. (Tutorial)
- Tutorial with Miniconda. (Tutorial)
- Poetry
- You can install it here: Poetry
I keep some sensitive variables in this file inside the config/toml folder. Create this file there if you're going to use ChatGPT for translation; otherwise, just ignore it.
[KEYS]
OPENAI_API_KEY = "..." # Simply create an account and go to this link: https://platform.openai.com/account/api-keys
ORG_ID = "..." # You can obtain this ID here: https://platform.openai.com/account/org-settings
SESSION_TOKEN = "..." # Only necessary if you're not using the OpenAI APII store a lot of information in .toml files within the toml folder located in the config directory. Some of them pertain to the messages I send to ChatGPT for translation. If you want to customize the application, I recommend taking a look there!
-
Clone the repository.
git clone https://github.com/Arekushi/nier-replicant-pt-br-translation.git
-
Install packages using
Poetrypoetry install
-
Run:
python main.py --help
-
You're all set to start developing! 🎉
I've set up some commands to ease the translation creation process; I'll list and describe a few here:
-
Extract Texts
python main.py builder extract-texts
This command initiates the process of extracting texts from the game.
Before starting, it checks if the game's
assetshave already been extracted. If not, it first extracts theassetsand then proceeds to extract the texts into a .CSV format, which is more user-friendly than the binary format from asset extraction.The texts will be found in the
texts/rawfolder. -
Creating Translation Folder
python main.py builder make-translation-folder
This command processes the
rawtext files, creating new .CSV files containing only the textual content for translation.To facilitate and aid in translation, it creates a .CSV with three columns:
- Translation column
- Source language column for translation
- Support language column for translation
If you wish to edit the source and support languages, go to the
settings.tomlfile and edit the variables:target_languagesource_languagesecondary_language
This way, it's easy to refer to the original texts and translate right away.
An important tip: if you want to create a new translation, I recommend either:
- Deleting the
text/translationsfolder - Modifying the name of the
translationsfolder in thesettings.tomlfile under the variables:paths_to_translatetranslation_folder_name
-
AI-Based Translation
python main.py builder translate
This command starts the translation process of the
translationfolder, so it's crucial to execute the previous command before starting this one.There are two methods for translation: ChatGPT or Google Translate.
Translation via Google is quick but often inaccurate. I've kept this module, although it's not actively used in the project anymore.
Nonetheless, to translate using Google Translate, add a flag indicating this in the method that will be executed:
nier-translator.exe builder translate --google
When it comes to ChatGPT, it's essential to decide whether you'll use a WebCrawler or the OpenAI API.
If you opt for a WebCrawler, edit/create the
.secrets.tomlfile within theconfig/tomlfolder and add theSESSION_TOKENobtained from logging into the ChatGPT page.If you encounter issues with the WebCrawler related to the Google Chrome version, I recommend downloading the ChromeDriver version from this link.
After that, edit the
driver.pyfile in theUnlimitedGPTlibrary. There's a Driver constructor; edit it to something like this:super().__init__( options=options, headless=headless, desired_capabilities=caps, driver_executable_path='F:\path_to_driver\chromedriver.exe' )
If you choose to use the API, edit/create the
.secrets.tomlfile within theconfig/tomlfolder and addOPENAI_API_KEYandORG_ID. In this case, you'll need to use a flag to indicate to the method to use the API instead of the WebCrawler.python main.py builder translate --api
Also, pay attention to the
chat-gpt.tomlfile; there, I define how the messages sent in the chat will be, for example, specifying that I want a translation from English to Brazilian Portuguese.DO NOT recommend modifying what's between the diamonds
<>if you're unsure. -
Generating .arc Files
python main.py builder generate
Finally, after making changes to the files in the
translationfolder, whether through automatic or manual translation, we arrive at the stage of reversing the process and generating the files that the game reads, which are the .ARC files.Executing this command will start the process and generate a result inside the
patch/datafolder. There, you'll find the files with your changes already made.To apply the changes, simply use the command
python main.py manager install --local
This way, the files from the
patch/datafolder will be copied to your game's location. Otherwise, you can perform the process manually.
Alexandre Ferreira de Lima 💻 |
Caroline Urbano 📚 |
Cristian Kirsch 📚 |
|---|
