IGLanguages
多语言插件
DISCORD | WIKI
IGLanguages 是一个强大且灵活的多语言管理插件,最初是为我的服务器 AfterLands 开发的。它提供了一种简单的方式,利用 PlaceholderAPI 将你的服务器动态翻译成其他语言。
基本上,只要有 PlaceholderAPI 支持的东西,你都可以翻译。很简单。;)

功能特性
- 多语言支持,采用易于管理的文件夹结构(支持子文件夹!)
- 兼容并已在 Spigot/Paper 1.8–1.21+ 上测试通过(需要 Java 11+)
- 自动识别玩家的客户端语言(如果该语言存在于你的语言文件夹中)
- 支持按玩家单独选择语言和存储(YAML、SQLite 或 MySQL)
- 支持 Redis 的 跨服同步,适用于 BungeeCord/Velocity 网络
- 自动回退至默认语言的翻译机制
- 首次加入和切换语言时可执行自定义操作(发送消息、音效、命令等)
- 集成 PlaceholderAPI 以实现动态翻译
- 使用 Caffeine Cache 和异步存储实现高性能
- 提供面向开发者的 API,以便与其他插件和系统集成
工作原理
- 每种语言都是一个文件夹,可以包含无限数量的翻译文件和子文件夹。
- 使用 PlaceholderAPI 根据玩家选择的语言动态显示翻译内容。
- 如果缺少翻译键,则使用默认语言键作为回退内容。
命令与权限
iglanguages.admin - 主要权限
iglanguages.updatechecker - 在加入时检查更新
| 命令 |
描述 |
/languages help |
显示帮助信息 |
/languages set <player> <lang> |
设置玩家的语言 |
/languages get <player> |
查看玩家的语言 |
/languages auto <player> |
自动检测玩家语言 |
/languages list |
列出可用语言 |
/languages reload |
重新加载配置和翻译文件 |
占位符
PlaceholderAPI 占位符:
%lang_(key)% - 显示玩家当前语言中对应键的翻译(根目录文件)。
%lang_(folder).(file)_(key)% - 显示子文件夹中文件的翻译 (例如 %lang_menus.main_shop_title% 对应 menus/main.yml)。
%lang_player% - 显示玩家当前的语言。
%lang_player_(nick)% - 显示指定玩家的语言。
性能优化
- 使用 Caffeine Cache(高性能、线程安全)来应对高负载情况。
- 所有翻译在启动时即加载到内存中。
- 数据库访问极少且高度优化(SQL 使用 HikariCP)。
- 对 YAML 保存进行防抖处理,以减少磁盘 I/O。
API
对于开发者,请查看 IGLanguagesAPI.java 以获取更多信息。我们提供了几个实用的方法(如 getPlayerLang、getLangTranslation、getPlayerTranslation 等)。更多详细信息请参阅我们的 GitHub 页面。
让你的服务器对所有人开放! ?
如需技术支持,请加入我们的 Discord 服务器:
IGLanguages
The Multi-Language Plugin
DISCORD | WIKI
IGLanguages is a powerful and flexible language management plugin initially made for my server AfterLands. It's an easy way to translate your server dynamically to other languages using PlaceholderAPI.
Basically, if it has PlaceholderAPI support, you can translate it. Simple. ;)

Features
- Multi-language support with easy folder-based structure (supports subfolders!)
- Compatible and tested with Spigot/Paper 1.8–1.21+ (Java 11+ required)
- Automatically identifies player's client language (if exists in your lang folders)
- Per-player language selection and storage (YAML, SQLite, or MySQL)
- Cross-Server Sync with Redis support for BungeeCord/Velocity networks
- Automatic fallback translation to default language
- Custom actions on first join and when changing language (messages, sounds, commands, etc.)
- PlaceholderAPI integration for dynamic translations
- High Performance with Caffeine Cache and asynchronous storage
- API for developers to integrate with other plugins and systems
How it Works
- Each language is a folder which can have infinite translation files and subfolders.
- Uses PlaceholderAPI to dynamically show translations based on the player's selected language.
- If a translation key is missing, the default language key is used as a fallback.
Commands & Permissions
iglanguages.admin - The main permission
iglanguages.updatechecker - Check updates on join
| Command |
Description |
/languages help |
Shows help message |
/languages set <player> <lang> |
Set a player's language |
/languages get <player> |
Show a player's language |
/languages auto <player> |
Auto detect player's language |
/languages list |
List available languages |
/languages reload |
Reload config and translations |
Placeholders
PlaceholderAPI placeholders:
%lang_(key)% - Shows translation for the key in the player's language (root files).
%lang_(folder).(file)_(key)% - Shows translation for files in subfolders (e.g. %lang_menus.main_shop_title% for menus/main.yml).
%lang_player% - Shows the player's current language.
%lang_player_(nick)% - Shows the specified player's language.
Performance
- Uses Caffeine Cache (high-performance, thread-safe) to assist with heavy loads.
- All translations are loaded into memory at startup.
- Database access is minimal and highly optimized (HikariCP for SQL).
- Debounced YAML saving to reduce disk I/O.
API
For developers, check IGLanguagesAPI.java for more details. We have several useful methods (like getPlayerLang, getLangTranslation, getPlayerTranslation, etc.). More information is available on our GitHub page.
Make your server accessible to everyone! ?
For support, join our Discord server:
评论 0
登录后参与评分
还没有评论,来抢沙发吧