Repository navigation
Fix tooltip translation through IMGUI hooks - #131
Merged
ManlyMarco merged 1 commit intoOct 19, 2026
Merged
Conversation
Render tooltips with GUI.Label and retain their GUIContent so IMGUI translators can update the text and subsequent repaints measure the translated height.
ManlyMarco
approved these changes
Oct 19, 2026
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.
Tooltip descriptions bypass XUnity.AutoTranslator's IMGUI hooks because
DrawTooltiprenders them directly withGUIStyle.Draw. Cached translations therefore remain unapplied, as reported in #130.Render tooltips with
GUI.Labelso they use the normal IMGUI translation path, and reuseImguiUtils.Contentto retain the translated text between repaints. The next repaint then calculates the tooltip height from the translated content, using the same mechanism already used by the other translated controls. This adds no translator dependency.Closes #130.
Validation:
dotnet restore ConfigurationManager.slnanddotnet build ConfigurationManager.sln --no-restore --configuration Release: Mono (net35) and IL2CPP (net6.0) build successfully.EnableIMGUI=True, with the standalone compatibility patch disabled: the unmodified upstream build reproduces both cached-translation failures; this change passes long translated text and multiline text, including translated tooltip height on subsequent repaints.FromLanguage=auto/Language=zh: new single-line and multiline tooltips initially miss the cache, enter normal XUnity translation jobs, complete and render in Chinese with correct height and preserved paragraph breaks, and are written to the generated translation file. Recreating their GUIContent then reuses cached translations without new job-creation calls. The probe only observes the normal GUI path and does not submit translations itself.