Fix: preserve skill names across language changes#466
Merged
MSchmoecker merged 1 commit intoValheim-Modding:devfrom Jan 2, 2026
Merged
Fix: preserve skill names across language changes#466MSchmoecker merged 1 commit intoValheim-Modding:devfrom
MSchmoecker merged 1 commit intoValheim-Modding:devfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Skill names lost after language change
Problem
When a skill is registered via
SkillManager.AddSkill()with a literal string forName(e.g.,Name = "Level") instead of a localization token, the skill displays correctly on initial load. However, after the user changes the game language, the skill name becomes[skill_XXXXXXX](the internal skill ID).Root Cause
SkillManager.RegisterCustomSkills()was adding skill translations directly toLocalization.instance:Localization.instance.AddWord($"skill_{skill.UID}", skill.LocalizedName);
When the game language changes,
Localization.SetupLanguage()clears and rebuilds the localization dictionary. TheLocalizationManagerpatch re-adds translations fromCustomLocalizationobjects, but skill translations were never stored there—they were lost.Fix
Changed to use
LocalizationManager.Instance.JotunnLocalization.AddTranslation(), which stores translations in theCustomLocalizationsystem. This ensures translations persist and are re-applied after language changes.LocalizationManager.Instance.JotunnLocalization.AddTranslation($"skill_{skill.UID}", skill.LocalizedName);This follows the same pattern used by
PieceManagerfor category translations.Testing
Name = "Level"[skill_XXXXXXX])