module_string 表
module_string表存储AzerothCore各模块的自定义字符串,按模块名分组管理。
表概述
module_string表是模块本地化系统的核心表,每个模块拥有独立的字符串命名空间。module字段为模块目录名(如mod-cfbg),id为模块内字符串编号,string为默认(英文)文本。
主键为 (module, id)。多语言翻译存储在module_string_locale表中。
表结构
| 字段名 | 数据类型 | 默认值 | 说明 |
|---|---|---|---|
| module | VARCHAR(255) | NOT NULL | 模块目录名(主键) |
| id | INT UNSIGNED | NOT NULL | 模块内字符串编号(主键) |
| string | TEXT | NOT NULL | 默认字符串文本 |
重要字段详解
module (模块命名空间)
模块在modules目录下的文件夹名称。常见模块:
- mod-cfbg - 战场统计模块
- mod-ah-bot - 拍卖行机器人
- mod-transmog - 幻化模块
实战案例
为模块添加字符串
INSERT INTO module_string (module, id, string)
VALUES ('mod-cfbg', 1, 'Welcome to the Cross-Faction Battleground!');
查询某模块的所有字符串
SELECT id, string
FROM module_string
WHERE module = 'mod-cfbg'
ORDER BY id;
常见问题
Q: 与acore_string有何区别?
A: acore_string是核心系统字符串(全局),module_string是第三方模块专属字符串(按模块隔离)。模块应使用此表而非acore_string。
Q: 多语言如何添加?
A: 默认文本存于module_string的string字段,各语言翻译通过module_string_locale表追加,支持koKR/frFR/deDE/zhCN/zhTW/esES/esMX/ruRU。