Hey!
So I was working on this localization plugin for my own game, Foxblade, and decided I'd go ahead and throw it up on Github in case anyone else finds it useful.
The plugin is designed to be really simple to use, so honestly there's not much to it. Localization files are stored in .csv files, designed to make it simple to edit in any standard spreadsheet application (Excel, OpenOffice, Google Sheets, etc), with a single key column and one translation column per language (based on specs provided by third party localization services, to make sure these files are as simple as possible for a third party to localize). It supports localizing all of the built-in RPG Maker text stuff (event text, event choices, scrolling text, party member names, menu items, battle text, items, skills, actions, etc). You can also localize image, video, and sound resources.
You can specify as many language files to load on startup as you'd like (as an example you can split up localization files by category). It also supports loading language files for each map, so for example you can store localization for a specific map's events into a file named after the map and it will be automatically loaded when the player enters that map (it will be unloaded as soon as the player transitions to another map, to keep memory usage reasonable).
Localization is also performed recursively, so any localized text can itself contain tokens which will be localized.
Plugin Parameters
- Directory for language files - this is the directory where language files should be stored, relative to your game's base directory. The default is to put files in /data/lang
- Directory to search for per-map language files - this is the directory where per-map language files should be stored. They should be named the same as the map's name (NOT its display name) with ".csv" appended (for example, if your map is MAP001, the associated language file would be MAP001.csv and would be put in this directory). The default is to put per-map files in /data/lang/maps
- Default files to load for localization - A list of default localization files which are loaded immediately on game startup
- List of supported language codes - A list of language codes which are supported by the game. This is used by the options screen to show a list of languages to choose from.
- Default language code - The default language to set. The default is "en-us"
- Key column name - The name of the column to look for localization keys. The default is "Key"
- Localize image & sound resources - If true, allows images, videos, & sound files to be redirected depending on the current language. The default is "true"
- Strict error mode - When strict mode is enabled, if any key cannot be located in currently loaded localization files an error will be displayed. Otherwise, the error will be silently logged to the console. The default is "false"
Usage
Anywhere you'd put text which would be displayed to the player (actor names, nicknames, profiles, item names & descriptions, skill messages, event show text, system terms, etc), you can simply put in a token of the form {{PUT_KEY_HERE}}. The localization plugin will search all currently loaded localization data for a row with a key column value of PUT_KEY_HERE, and will substitute that token with the value of the current language column. If the key could not be found, or there is no language column for the current language, it will simply paste in the text PUT_KEY_HERE unless strict mode is enabled (in which case an error will be displayed and the game halted).
You can also parameterize text. For example, if the localized text of PUT_KEY_HERE is "Test message: %1 %2 %3", you can do this: {{PUT_KEY_HERE:"parameter 1" "parameter 2" "parameter 3"}} and each quoted text will be used to replace %1, %2, and %3 respectively.
For image, video, & sound resources, instead of defining an arbitrary key you will put the original path to the resource in the Key column, and put a redirected path in the language column.
At runtime, calls to load these resources will automatically be redirected to the correct path depending on the selected language.
Script API
All of these can be called from a Script call in an event, or they can be called from other plugins.
JavaScript:
- L18NManager.getLanguage(langCode) // get the current language code
- L18NManager.setLanguage(langCode) // set the current language code
- L18NManager.getLanguageList() // get the list of supported languages
- L18NManager.loadLanguageFile(langFile) // load translations from the given localization file
- L18NManager.localizeText(text) // replace special tokens of the form {{KEY}} in the given text with translations fetched from all loaded localization files
- L18NManager.localizeResource(url) // return the path to the localized version of the given resource url, or the original url if that resource is not localized or resource localization is disabled
复制代码
Anyway, the source code is here in case it's useful! You can do whatever you want, commercial or noncommercial. Attribution is not required, but appreciated.
GitHub - GlaireDaggers/GD-Localization-For-RMMV: Localization plugin for RPG Maker MV
Localization plugin for RPG Maker MV. Contribute to GlaireDaggers/GD-Localization-For-RMMV development by creating an account on GitHub.

github.com
本贴来自国际rpgmaker官方论坛作者:GlaireDaggers处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/gd-localization-yet-another-l18n-plugin.145927/