Show localised names of mod settings in the web UI (#1181)

The mod pack page only looked up mod-setting-name.<name>, so settings
with a localised_name showed the internal name, and rich text tags in
the locale showed up as raw text.

Resolve localised_name and localised_description from the exported
settings prototypes against the exported locale, falling back to the
mod-setting-name/mod-setting-description keys and then the internal
name. The resolver handles parameters, the "" and "?" keys and
__ITEM__/__ENTITY__/__TILE__/__FLUID__ references. Rich text
formatting tags are removed and prototype icons are replaced with
their name.

Fixes #768

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
BastiaanandClaude Opus 5.5 authored and GitHub committed 2026-11-04 18:02:37 +00:00
1 parent c6867de13d
commit 6d9a32d28b
5 files changed
+290 -4

No files matched your search

+4
View File
@@ -8,6 +8,8 @@ export type ModSettingField = {
mod?: string;
order?: string;
allowed_values?: unknown;
localised_name?: lib.FactorioLocalisedString;
localised_description?: lib.FactorioLocalisedString;
};
const settingTypes = ["bool-setting", "int-setting", "double-setting", "string-setting", "color-setting"];
@@ -50,6 +52,8 @@ export function modSettingFields(
mod: p.mod as string,
order: p.order,
allowed_values: p.allowed_values,
localised_name: p.localised_name,
localised_description: p.localised_description,
}))
.sort((a, b) => strcmp(a.mod, b.mod) || strcmp(a.order || "", b.order || "") || strcmp(a.name, b.name))
;