[Plugin] RMMZ i18n Plugin - Multi-language Support with Dynamic Language Change
I'm excited to share my new i18n plugin for RPG Maker MZ! This plugin allows you to easily add multi-language support to your game, providing a seamless way to switch between different languages and ensure all game texts are properly localized.Features
[*]Default Language Setting: Set a default language for your game with the defaultLanguage parameter.
[*]Automatic Language File Creation: Automatically create a default language file (en.json) in the data/i18n/ directory upon first load.
[*]Language File Sync: Ensure all language files are synchronized with the default language file, adding missing keys automatically.
[*]Localization Key Replacement: Replace localization keys (e.g., ${start-game}) in all game texts with the appropriate translations.
[*]Dynamic Language Change: Allow players to change the game language using directional keys in the options menu.
[*]Display Language Names: Show the full language name (e.g., "English") instead of the language code in the options menu using the i18n-name key from language files.
[*]Optional Language Menu: Add a language option to the game settings menu with the addLanguageMenu parameter.
Installation
[*]Download the i18n.js file from this repository.
[*]Copy the i18n.js file into your project's plugins folder.
[*]When the plugin is first loaded, it will create a default en.json file in the data/i18n/ directory. This file contains the default language keys.
[*]Add the Plugin in RPG Maker MZ:
[*]Open your RPG Maker MZ project.
[*]Go to the "Plugin Manager."
[*]Click on an empty row, and add the i18n.js plugin.
[*]Set the "Default Language Code" parameter to your desired default language (e.g., en for English, pt for Portuguese).
[*]Set the "Add Language Menu" parameter to true if you want to add a language option to the game settings menu.
Usage
The plugin will create a default en.json file with the following structure:
JSON:
{
"i18n-code": "en",
"i18n-name": "English",
"language": "Language",
"start-game": "Start Game",
"options": "Options",
"exit": "Exit"
}
[*]You can create additional language files (e.g., pt.json, jp.json) in the same folder with the appropriate translations.
[*]When the game starts, the plugin will check all language files to ensure they have the same keys as the default language file. Missing keys will be added automatically.
[*]If "Add Language Menu" is set to true, players can select the language in the options menu using the directional keys.
[*]Use localization keys in your texts, like ${start-game}, and they will be replaced with the appropriate translation.
License
This project is licensed under the Creative Commons Attribution 4.0 International License. You are free to share, adapt, and use this project for both commercial and non-commercial purposes as long as you provide appropriate credit to the author.
See the LICENSE file for more details.
本贴来自国际rpgmaker官方论坛作者:omanoloneto处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/plugin-rmmz-i18n-plugin-multi-language-support-with-dynamic-language-change.170235/
页:
[1]