Skip to content

fix(translation): show a role's own text when its locale key has no translation - #3

Merged
XaineDev merged 1 commit into
mainfrom
fix/role-name-fallback
Oct 1, 2026
Merged

XaineDev merged 1 commit into
mainfrom
fix/role-name-fallback

Conversation

@XaineDev

@XaineDev XaineDev commented Oct 1, 2026

Copy link
Copy Markdown
Member

Mods built against MiraAPI 0.4.0 set RoleName / RoleDescription / RoleLongDescription directly and ship no locale files. CustomRoleManager registers the role's vanilla StringName and blurbs under the locale keys (BuildTranslationId: namespace + type name), and MiraLocalizationProvider returned the key itself when it had no translation, so the role screen, intro and settings showed e.g. "PlagueDoctor.Role.PlagueDoctor.PlagueDoctorRole" instead of "Plague Doctor".

GetOrCreateLocaleString gains an overload taking a fallback, used while the key has no translation; the role StringNames pass the role's own RoleName / RoleDescription / RoleMedDescription / RoleLongDescription. Mods with locale files are unaffected: their translation still wins, and the default RoleName already resolves through the same key.

Verified in Freeplay with PlagueDoctor (no locale files): TranslationController.GetString on the role's StringName, BlurbName and BlurbNameLong returned the keys before and "Plague Doctor" and the role's own blurbs after.

@XaineDev
XaineDev merged commit 7c5d8f5 into main Oct 1, 2026
2 checks passed
@XaineDev
XaineDev deleted the fix/role-name-fallback branch October 1, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant