frontend: Localize startup failures with typed errors - #13872
Closed
rwinkelman wants to merge 1 commit into
Closed
Conversation
AppInit and GetLocaleNames threw bare C strings, so the catch site could only show an untranslated English message. Add OBSInitException with an error code, map each code to Init.Error.* via QTStr, and keep the developer detail string for the log line. Other const-char throws (outputs/modules) are unchanged for now. Fixes obsproject#13394
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.
Description
Startup failures from
OBSApp::AppInitandGetLocaleNameswere thrown as bareconst char *strings. The catch site inobs-main.cppcould only surface that English text, so users on other locales saw an untranslated error dialog.This adds
OBSInitExceptionwith anOBSInitErrorCode, keeps a short developer detail string for logging, and maps each code to a newInit.Error.*string inen-US.iniviaQTStrfor the dialog. Otherconst char *throws (outputs/modules) are left alone for a later change; the old catch remains as a fallback.Motivation and Context
Fixes #13394. Matches the typed-error approach discussed on that issue.
How Has This Been Tested?
Built the changed frontend sources locally with the project clang-format config applied. Full OBS CI needs maintainer workflow approval for first-time contributors.
Manual check still needed: normal launch, and a forced AppInit failure path to confirm the dialog uses
Init.Error.*and the log line includes the error code name.Types of changes
Checklist: