(Undo revision 623 by TheICTLiker4 (talk))
m
 
Line 1: Line 1:
 
This page describes how to '''translate the game into a different language'''.
[[File:Translating.png|thumb|220x220px]]
 
  +
This article describes how to '''translate the game into a different language'''.
 
 
== Translating the game ==
   
== 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.
 
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:
 
The text that can be extracted is as follows:
  +
 
* Anything in the scripts that is inside one of the following: <code>_INTL("text")</code>, <code>_ISPRINTF("text")</code>. This can include filenames, e.g. allowing you to use different graphics for different languages.
 
* Anything in the scripts that is inside one of the following: <code>_INTL("text")</code>, <code>_ISPRINTF("text")</code>. This can include filenames, e.g. allowing you to use different graphics for different languages.
* Compiled text taken from the PBS files.
+
* Compiled text taken from the [[PBS file]]s.
 
* Any text messages and choice options in events, and anything in event script commands that is inside the following: <code>_I("text")</code>.
 
* Any text messages and choice options in events, and anything in event script commands that is inside the following: <code>_I("text")</code>.
 
* Map names.
 
* 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.
 
  +
== Step 1: Extracting the text ==
  +
[[Image:Translating.png|right|256px|thumb|Extracting the game's text.]]
 
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.
 
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 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 [[Compiler|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.
 
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 ==
+
== Step 2: 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".
+
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.
 
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 <code>LANGUAGES</code> to include both the English line (default) and another line for your new language.
+
Finally, in the [[script section]] '''Settings''', edit the array <code>LANGUAGES</code> to include both the English line (default) and another line for your new language.
   
 
== Bugs and restrictions ==
 
== 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 an event [[Map transfers|moves the player]] to another map but then shows a message, the message will be shown while on the new map but the message is actually written in the event on the old map. This means that the message cannot (normally) be translated, because it only checks for translations of messages amongst the current map's messages.
  +
** The easiest way around this is to ensure this does not happen. Any messages shown after a [[Map transfers|map transfer]] should be displayed by events on the new map.
 
* If there are any <code>\n</code> in the text extracted from the scripts (ignore text extracted from elsewhere), you will need to change them to <code><<n>></code> in order for them to work properly.
 
* If there are any <code>\n</code> in the text extracted from the scripts (ignore text extracted from elsewhere), you will need to change them to <code><<n>></code> in order for them to work properly.
   
 
== Tips ==
 
== Tips ==
  +
 
* Translating your game should be the very last thing you do.
 
* 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.
 
* You can manually add more line pairs into the extracted text file, or edit existing ones there, rather than extracting all the text again.

Latest revision as of 15:40, 24 August 2019

This page describes how to translate the game into a different language.

Translating the game

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: _INTL("text")_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: _I("text").
  • Map names.

Step 1: Extracting the text

Extracting the game's text.

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.

Step 2: 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 an event moves the player to another map but then shows a message, the message will be shown while on the new map but the message is actually written in the event on the old map. This means that the message cannot (normally) be translated, because it only checks for translations of messages amongst the current map's messages.
    • The easiest way around this is to ensure this does not happen. Any messages shown after a map transfer should be displayed by events on the new map.
  • If there are any \n in 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.

Tips

  • 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 "[22]".
Community content is available under CC-BY-SA unless otherwise noted.