This article describes how to translate the game into a different language.
Extracting the text
You can extract all the text in your game and save it in a text file. Then, after translating this text, you can recompile it into your game.
The text that can be extracted is as follows:
- Anything in the scripts that is inside one of the following:
_ISPRINTF("text"). This can include filenames, e.g. allowing you to use different graphics for different languages.
- Compiled text taken from the PBS files.
- Any text messages and choice options in events, and anything in event script commands that is inside the following:
- Map names.
Text can be extracted by using the Debug mode option "Extract text". This will save all the game's text (of the last time that the game is compiled) in a file called "intl.txt" in the game folder.
Translate the text by changing every second line in that file to the translated version of that line.
Note that text, which used to be in the scripts but no longer is, will still remain in the extracted text file, due to the way in which messages work. Ideally, you should delete the file "messages.dat" from the game's Data folder, and then fully compile the game (i.e. hold Ctrl while running it from RPG Maker XP) to ensure only the existing messages are extracted.
Note also that if the exact same message appears multiple times in the same section (e.g. in the scripts, or in one map's events), then that message will only appear once in that section in the extracted text. You will not have to translate the same line in the same section more than once.
Compiling the translated text
To add the translated text back into your game, choose the Debug mode option "Compile text". This will convert the translated text and save it as the file "intl.dat".
Then rename this file to something else (e.g. "french.dat") and move it to the "Data" folder.
Finally, in the script section Settings, edit the array
LANGUAGES to include both the English line (default) and another line for your new language.
Bugs and restrictions
- if you have text in an event after a Transfer Player command, that text will not be translated if it does not appear in the new map's section of the extracted text (even though it is in the old map's event). You should either add the appropriate lines to the new map's section, or use an Autorun event on the new map to show the text instead.
- If there are any
\nin the text extracted from the scripts (ignore text extracted from elsewhere), you will need to change them to
<<n>>in order for them to work properly.
- Translating your game should be the very last thing you do.
- You can manually add more line pairs into the extracted text file, or edit existing ones there, rather than extracting all the text again.
- If you're not going to translate a line, you can remove it from the extracted text file. It will not cause a problem; the original text will simply be used instead. You can remove all text and even sections except "[Map0]" and "".
- Example in-battle phrases in some languages:
|English||Japanese||Japanese (literally translated to English)||German||German (literally translated to English)|
|(PKMN) used (Move)!||ポケモンの わざ！|
Pokemon no waza!
|(PKMN)'s (Move)!||(PKMN) setzt (Attack) ein!||(PKMN) uses (Move)!|
|(Trainer) sent out (PKMN)!||トレーナーは ポケモンを くりだした！|
Torēnā wa Pokemon o kuridashita!
|(Trainer) paid out (PKMN)!||(PKMN) wird von (Trainer) in den Kampf geschickt!||(PKMN) is sent into the fight by (Trainer)!|