- Joined
- Jun 6, 2020
- Messages
- 723
- Reaction score
- 313
- First Language
- English
- Primarily Uses
- RMMV
Translate your Game!
I realize that there already exist at least two other localization plugins (one originally by Iavra, another by DK). However, I figure this is still worth posting because the approach is totally different from both of those.
The plugin itself has detailed documentation in the plugin itself and some additional information in the demo project. However, I will give a summary here as well.
Once you have installed SFG_Utils, jsonpath, and my localization plugin, a new scene is added to the game allowing you to manage your translations. At the title screen, press F9 to bring up the language menu. (This menu will automatically be disabled in a deployed build.) You can choose to export your source language or import any languages that you defined in the plugin's parameters.
The plugin works by scanning your game for information that would need to be translated and building up a database which specifies what the string is and where it exists in your game. By default, it scans the entire database and all your maps. It does not scan plugins by default, as there is no way for it to know what parameters in a plugin would need to be translated, but you can easily configure what plugin data it gathers in its parameters.
It also supports translating assets (sounds, images, and movies). By default it marks the Game Over, Loading, and Made with MV pictures as translatable assets. You can configure whatever other assets you choose in the plugin parameters. You will need to create translated versions of the assets and link them to the source asset in the parameters.
Gathering strings from plugins is difficult. Many plugins do strange things that make it difficult or impossible for this plugin to gather its strings and translate them. However, I have done my best to provide as many ways as possible to configure the plugin to find them. It directly supports standard note tags (the ones that automatically parse to "meta" keys), and offers an advanced configuration mode which allows gathering from arbitrary global JavaScript objects.
When you export your language, a .POT file is produced in a translations folder in your project's root directory. This file contains all the strings the plugin knows about in a standard format. There are a wide variety of editors available for editing .POT files, so whoever is doing the actual work of translating can choose the tool they like best. When you open a .POT file in one of these editors, it will create a .PO file to hold the translated strings. If you place the .PO file in the translations folder, you can then import those translations back into the game using the title F9 menu.
The plugin automatically adds an option to select the language from the Options screen. If you use an options manager however (such as Yanfly's or SRD's), you will probably need to add the option back manually.
Note: Before exporting or importing, be sure to switch to the default language in the Options screen. Otherwise, the export/import may not work correctly.
The plugin works by scanning your game for information that would need to be translated and building up a database which specifies what the string is and where it exists in your game. By default, it scans the entire database and all your maps. It does not scan plugins by default, as there is no way for it to know what parameters in a plugin would need to be translated, but you can easily configure what plugin data it gathers in its parameters.
It also supports translating assets (sounds, images, and movies). By default it marks the Game Over, Loading, and Made with MV pictures as translatable assets. You can configure whatever other assets you choose in the plugin parameters. You will need to create translated versions of the assets and link them to the source asset in the parameters.
Gathering strings from plugins is difficult. Many plugins do strange things that make it difficult or impossible for this plugin to gather its strings and translate them. However, I have done my best to provide as many ways as possible to configure the plugin to find them. It directly supports standard note tags (the ones that automatically parse to "meta" keys), and offers an advanced configuration mode which allows gathering from arbitrary global JavaScript objects.
When you export your language, a .POT file is produced in a translations folder in your project's root directory. This file contains all the strings the plugin knows about in a standard format. There are a wide variety of editors available for editing .POT files, so whoever is doing the actual work of translating can choose the tool they like best. When you open a .POT file in one of these editors, it will create a .PO file to hold the translated strings. If you place the .PO file in the translations folder, you can then import those translations back into the game using the title F9 menu.
The plugin automatically adds an option to select the language from the Options screen. If you use an options manager however (such as Yanfly's or SRD's), you will probably need to add the option back manually.
Note: Before exporting or importing, be sure to switch to the default language in the Options screen. Otherwise, the export/import may not work correctly.
I have a work-in-progress demo to showcase the plugin at work, featuring a rather amateurish French translation. Though this contains translations of all default database strings (such as terms and messages), don't use these translations in a game. I didn't put much effort into them, and it would probably just make both you and me look bad. The demo also includes altered versions of some Kadokawa plugins which make them compatible with this plugin. (NB: The demo contains a slightly older version of the plugin, so I recommend also downloading the latest version and substituting that into the demo project.)
I'm posting this here instead of in releases because there are some issues I haven't worked out. Some of them are problems with RPGMaker itself - the way it builds messages is not very translation-friendly. All the core messages editable in Terms are impossible to correctly translate into any language with grammatical gender, for example (including French). In fact, the plugin currently has no means of dealing with grammatical gender or plurality. (There's a note tag to specify gender, but it's just a stub, not used at this time.)
I'm open to suggestions on how to handle things like plurality and gender. I'm not sure if the problem is generically solvable, but I'm sure there has to be a way that gets close.
Import or export language catalogs from within your test game

Open the POT file in any PO editor to produce a PO file that can be imported back into the game
This screenshot shows PoEdit running on a Mac, but there are many other PO editors available online for Windows, Mac, and Linux.
Switch languages at runtime in the Options menu

Easily configure available languages in the plugin parameters

Configure translatable assets in the plugin parameters

With some configuration, this plugin can even gather strings from other plugins



Note: Advanced mode, above, may be able to support plugin parameters or note tags that aren't supported by the other two modes.

Open the POT file in any PO editor to produce a PO file that can be imported back into the game
This screenshot shows PoEdit running on a Mac, but there are many other PO editors available online for Windows, Mac, and Linux.
Switch languages at runtime in the Options menu

Easily configure available languages in the plugin parameters

Configure translatable assets in the plugin parameters

With some configuration, this plugin can even gather strings from other plugins



Note: Advanced mode, above, may be able to support plugin parameters or note tags that aren't supported by the other two modes.
TERMS
- If you're making a non-commercial game, feel free to make use of this plugin as long as you give credit. I would prefer if you don't modify the code without permission, however - if you find a bug, or need a feature I didn't think of, I'd like to hear of it so I can release the bugfix or (assuming I like the idea) the new feature to everyone.
- Don't post the file anywhere else. You can link to this thread instead.
- Don't use anything from the demo in your game. (Exception: any included plugin that's a modification of a Kadokawa plugin can be used, as can SFG_ExtraMaps which is a modification of Zeriab_ExtraMaps.)
- Regarding commercial games, I haven't yet decided on terms. Feel free to make suggestions.
Attachments
Last edited: