Skip to content

支持读取模组自带的本地化名称和简介 - #7232

Open
Wulian233 wants to merge 3 commits into
HMCL-dev:mainfrom
Wulian233:modlang
Open

Wulian233 wants to merge 3 commits into
HMCL-dev:mainfrom
Wulian233:modlang

Conversation

@Wulian233

@Wulian233 Wulian233 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Close #5641

Modmenu和Forge/Neoforge都支持让模组本体本地化模组名和简介,本地化的内容为模组作者发布的官方版。目前相当数量的模组都支持了此功能。格式为:

"fml.menu.mods.info.displayname.{modid}"
"fml.menu.mods.info.description.{modid}"

"modmenu.nameTranslation.{modid}"
"modmenu.descriptionTranslation.{modid}"
image

如果我们检测到模组存在本地化内容,则会使用此翻译并为最高优先级,再尝试匹配百科数据,再回退到英文原名

@github-actions github-actions Bot added the 100+ label Nov 7, 2026
@ToobLac

This comment was marked as outdated.

displayName = localModFile.getFileName();
String localizedName = localization.name();
if (!localizedName.isEmpty())
return (abbreviation.isEmpty() ? "" : "[" + abbreviation.trim() + "] ")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注,因为模组数据本身不包含缩写,所以为了显示[缩写]还需要读一遍百科数据,大概是[百科缩写]模组本地化名(模组原名)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 自动扫描模组jar是否包含本地化文件

2 participants